Plotting a 3-D Function with Interpolated Shading
이전 댓글 표시
I am having issues with the meshgrid ( http://www.mathworks.com/help/matlab/ref/meshgrid.html ) function. I need X and Y to be a 21x25 matrix but this function is only generating a 21x26 matrix when I use the following command:
[X,Y] = meshgrid(0:.04:1, 0:.024:0.5);
Z = cos(2*pi*(3.*X - 4.*Y))
surf(X,Y,Z)
X and Y are bounded by the following:
0<= X <= 1 (Need 25 data points)
&
0<= Y <= 0.5 (Need 21 data points)
I figure that 1 / 25 should give me 25 total data points for the X bounary and 0.5 / 21 should give me 21 total data points for the Y boundary.
However, meshgrid is giving me a 21x26 matrix. Is the parameter argument incorrect for the function?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics Objects에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!