How to plot the following function in 3D ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Hello I want to plot f(x,y)=2+0.1(x)+0.008(x+y)^2+sin(x-y)so my code line is
clear x=0:0.2:10; y=0:0.2:10; [xgrid, ygrid]=meshgrid(x,y); z=2+(0.1*xgrid)+0.008*(xgrid+ygrid).^2+sin.*(xgrid-ygrid); mesh(xgrid, ygrid, z) xlabel('x') ylabel('y') title('graph z=2+0.1.*xgrid+0.008.*(xgrid+ygrid).^2+sin.*(xgrid-ygrid')
but i keep getting an error for fifth line saying that not enough input arguments. i don`t understand what i have done wrong . if someone could help me i's be grateful. thanks.
0 Kommentare
Antworten (1)
Roger Stafford
am 21 Mär. 2014
In that fifth line you have "sin.*(xgrid-ygrid)" instead of sin(xgrid-ygrid). The compiler can't find an argument for the 'sin' function, hence the error message.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Axis Labels finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!