How to plot the following function in 3D ?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
Roger Stafford
el 21 de Mzo. de 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 comentarios
Ver también
Categorías
Más información sobre Axis Labels en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!