How to turn a single vector into matrix in order to have mesh or 3D
4 次查看(过去 30 天)
显示 更早的评论
Hello all,
I plotted a vector H versus a vector r. its possible to have a plot 3D, i.e H as a function of x and y. r^2=x^2+y^2. Is there a direct method? Thank you for your suggestions !! Adam
0 个评论
回答(1 个)
Doug Hull
2012-8-24
x = linspace(-1,1);
y = linspace(-1,1);
[X,Y] = meshgrid(x,y);
R = sqrt(X.^2 + Y.^2);
surf(X,Y,R)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!