Plotting in 3d
조회 수: 8 (최근 30일)
이전 댓글 표시
How do I plot z=1/sqrt(x^2+y^2) in Matlab?
댓글 수: 0
답변 (2개)
Alexander
2020년 7월 31일
x = 1:0.1:10;
y = 1:0.1:10;
[X,Y] = meshgrid(x,y);
Z=1./sqrt(X.^2+Y.^2);
imagesc(x,y,Z)
댓글 수: 4
Alexander
2020년 7월 31일
as an example, I plotted x/y in 1 to 10 range. You can substitute with whatever ranges you need. "0.1" is the step for x/y variables. x = 1:0.1:10 creates a vector of number [1 1.1 1.2 ..... 9.9 10].
참고 항목
카테고리
Help Center 및 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!