필터 지우기
필터 지우기

How can I graph this function?

조회 수: 1 (최근 30일)
JXT119
JXT119 2021년 2월 25일
답변: Matteo Pellegri 2021년 2월 27일
I know it´s pretty basic, but I just need to graph these functions and I certainly know nothing about graphs in matlab.
The functions are z = (5*(x^2 )(y^4 ))/(x^2+y^2 ) and a similar one. When I try to graph them I get a z matrix full of Nan.
What code should I use?
  댓글 수: 2
James Tursa
James Tursa 2021년 2월 25일
Please show us your current code and we can suggest corrections.
JXT119
JXT119 2021년 2월 25일
@James Tursa My code is similar to the one Matteo has written, but what I want to get is something like this
Is it possible to do such thing?

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

채택된 답변

Matteo Pellegri
Matteo Pellegri 2021년 2월 27일
You can use the symbolic toolbox.
syms x y
f(x,y) = 5*x^2*y^4/(x^2+y^2);
fsurf(f(x,y));
You adjust the aspect of the graph yourself.
Alternatively if you use the matix form you should use element-wise operation i.e.
[x,y] = meshgrid(-100:100,-100:100);
z = (5*(x.^2 ).*(y.^4 ))./(x.^2+y.^2);
surf(x,y,z);

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by