How can I graph this function?
2 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
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 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Directed Graphs についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!