フィルターのクリア

How to graph a f(x,y) function?

75 ビュー (過去 30 日間)
Kristopher
Kristopher 2014 年 10 月 7 日
コメント済み: Damon Bernard 2022 年 4 月 12 日
I took a Matlab course over the summer, and now have to graph a problem in calculus. I am rusty on my commands, so I'm not sure which one to use. I am trying to make a 3-d plot of a function f(x,y)=-(x^2-1)^2-(x^2y-x-1)^2. Do I have to open a function, or can I just use a command with a script?

回答 (3 件)

Saikat Chakraborty
Saikat Chakraborty 2021 年 5 月 14 日
syms x y
f(x,y)=-(x^2-1)^2-(x^2y-x-1)^2
ezplot(f)

José-Luis
José-Luis 2014 年 10 月 7 日
編集済み: José-Luis 2014 年 10 月 7 日
x_int = [0 1];
y_int = [0 1];
[X Y] = ndgrid(linspace(x_int(1),x_int(2),150),...
linspace(y_int(1),y_int(2),150));
myFun = @(x,y) (x.^2-1).^2-(x.^(2*y)-x-1).^2
mesh(X,Y,myFun(X,Y))

Azzi Abdelmalek
Azzi Abdelmalek 2014 年 10 月 7 日
x=0:0.1:10;
y=0:0.1:10;
z=-(x.^2-1).^2-(x.^2*y-x-1).^2
plot3(x,y,z)
  1 件のコメント
Damon Bernard
Damon Bernard 2022 年 4 月 12 日
doesn't work

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

カテゴリ

Help Center および File ExchangeGraph and Network Algorithms についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by