필터 지우기
필터 지우기

How can I plot this function

조회 수: 1 (최근 30일)
B.E.
B.E. 2019년 10월 16일
댓글: B.E. 2019년 10월 16일
I want to plot this function in the interval
Thank you
  댓글 수: 1
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2019년 10월 16일
Could you please show here what you've done so far?
General points: you'd need to employ logical indexing or [for .. end] or [while .. end] loop interation operators.
Good luck.

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

채택된 답변

Fabio Freschi
Fabio Freschi 2019년 10월 16일
편집: Fabio Freschi 2019년 10월 16일
You may use surf
% define a suitable number of x and y divisions. Here I used 200
x = linspace(0,10,200);
y = linspace(1,30,200);
% crate regular grid (xx and yy are 2d matrices)
[xx,yy] = meshgrid(x,y);
% you can also put your z function with if-else in a separate m-file
>> fun = @(x,y)(exp(-x.^2)+cos(pi*x))+(x>5).*log(y);
% evaluate your function
zz = fun(xx,yy);
% use surf to plot
figure,surf(xx,yy,zz)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by