How to 3D plot function

4 ビュー (過去 30 日間)
André Macedo
André Macedo 2020 年 10 月 30 日
コメント済み: André Macedo 2020 年 10 月 30 日
Hello, I'm trying to 3D plot the following function:
function f = spheresize(x)
f=((3*x(1)^2*x(2))/4*pi)^(1/3);
end
I'm very new to mathlab so I've been trying different ways of doing it (plot3, ezsurf, fsurf) but I always come up with some error... I know I have to feed it some vectors but I'm not really sure the correct way to do it and I haven't been able to get it by googling other examples.

採用された回答

Walter Roberson
Walter Roberson 2020 年 10 月 30 日
fsurf(@(x,y)spheresize([x;y]), [-5 5 0 10])
function f = spheresize(x)
f=((3*x(1,:).^2.*x(2,:))/4*pi).^(1/3);
end
  1 件のコメント
André Macedo
André Macedo 2020 年 10 月 30 日
Thank you so much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by