how to plot meshgrid and mesh

조회 수: 33 (최근 30일)
NIMA RAHMANI MEHDIABADI
NIMA RAHMANI MEHDIABADI 2019년 5월 15일
답변: madhan ravi 2019년 5월 15일
so im trying to plot a meshgrid and mesh for a function of z = 2xsin^2(x)
so my code is;
clear;
x = linspace(-3,3);
y = linspace(1,3);
[x,y] = meshgrid(x,y);
z = 2.*x.*(sin(x)).^2;
mesh(x,y,z)
meshgrid(x,y,z)
however to plot the meshgrid graph it gives mee an error. Can someone plz help me with this?
Thanks

채택된 답변

madhan ravi
madhan ravi 2019년 5월 15일
Remove last line.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by