필터 지우기
필터 지우기

how to draw surface

조회 수: 6 (최근 30일)
Beyza Taka
Beyza Taka 2020년 5월 7일
댓글: Ameer Hamza 2020년 5월 8일
how do I write the program that draws the two-dimensional integral surface of the function in Matlab ?

채택된 답변

Ameer Hamza
Ameer Hamza 2020년 5월 8일
편집: Ameer Hamza 2020년 5월 8일
You can draw it using meshgrid and surf
[X, Y] = meshgrid(linspace(-3,3));
Z = exp(-X.^2-Y.^2);
surf(X,Y,Z)
shading interp
  댓글 수: 9
Ameer Hamza
Ameer Hamza 2020년 5월 8일
I am glad to be of help.
Ameer Hamza
Ameer Hamza 2020년 5월 8일
FYI, this is a faster version of the previous code in the comment
syms x y X Y
fun = matlabFunction(int(int(z,x,0,X),y,0,Y), 'Var', {X, Y});
[Xg, Yg] = meshgrid(linspace(0,2));
Z = arrayfun(fun, Xg, Yg);
surf(Xg,Yg,Z)
shading interp

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by