Regarding 3D plots with Matlab
1 回表示 (過去 30 日間)
古いコメントを表示
Hi - im trying to do a 3D plot in Matlab
I have a user defined function of the form:
[Number,~,...] = myfunc(parameter,arg2,...)
The first output argument (Number) is a real number. Parameter is a vector in 2 dimensional space. Can someone tell me how to plot Number on the z - axis given a prespecified set to which parameter belongs.
Thanks
0 件のコメント
採用された回答
Matt Tearle
2011 年 3 月 23 日
So what kind of visualization do you want at the end? Do you want a surface? In which case you could do something like
x = 0:0.1:1;
y = -1:0.05:2;
[X,Y] = meshgrid(x,y);
params = [X(:),Y(:)];
n = size(params,1);
Z = zeros(n,1);
for k=1:n
Z(k) = myfunc(params(k,:),...);
end
Z = reshape(Z,size(X));
surf(X,Y,Z)
その他の回答 (1 件)
Matt Tearle
2011 年 3 月 22 日
I'm not sure I understand what you're after. It sounds a bit like
plot3(parameter(1),parameter(2),Number,'o')
参考
カテゴリ
Help Center および File Exchange で Annotations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!