How do I plot 3-dimentional graph of the following function? Can Plot3 function do this?

1 回表示 (過去 30 日間)
fun=@(x,y)100*(y-x^2)^2+(1-x)^2;

採用された回答

Walter Roberson
Walter Roberson 2015 年 10 月 9 日
fun = @(x,y)100*(y-x.^2).^2 + (1-x).^2;
x = linspace(-10,10);
y = linspace(-50,-30);
plot3d(x, y, fun(x,y))
  3 件のコメント
Steven Lord
Steven Lord 2015 年 10 月 9 日
Your function is defined in such a way that you can pass x and y matrices, not just vectors or scalars, into it. Because of that take a look at the MESHGRID function to generate the data points at which you evaluate and plot your function.
Shawn Miller
Shawn Miller 2015 年 10 月 10 日
Thanks Steven, you're right. Also thanks to Walter.

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

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by