What Does this error even mean??
이전 댓글 표시
[x, y, z]=meshgrid(0.5:0.05:0.5, 0.5:0.05:0.5, 0.5:0.05:0.5);
a=0;
for l=1:length(x)
for j=1:length(y)
for k=1:length(z)
a(l, j, k)=k-sqrt((0.25)-((0.58-(l).^2))-((0.58-(j).^2)));
end
end
end
surf(x,z,a)
*Error using surf (line 75)
Z must be a matrix, not a scalar or vector*
답변 (1개)
the cyclist
2013년 10월 20일
The way you have defined x y and z, they are each just a single number (i.e. a "scalar").
I think maybe you meant
[x, y, z]=meshgrid(-0.5:0.05:0.5, -0.5:0.05:0.5, -0.5:0.05:0.5);
I still get an error from your code when I make that replacement, but I am not quite sure what you intended. I suggest you give
doc surf
a careful read.
카테고리
도움말 센터 및 File Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!