How to plot the following function in 3D ?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Roger Stafford
2014년 3월 21일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!