How to turn a single vector into matrix in order to have mesh or 3D
조회 수: 7 (최근 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)
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!