I am trying to plot a matlab function with 2 variables. I want to fix one variable and provide a definite range for other variable. Let me know how do I achieve this.

3 ビュー (過去 30 日間)
I am trying to plot a matlab function with 2 variables. I want to fix one variable and provide a definite range for other variable. Let me know how do I achieve this.

採用された回答

Walter Roberson
Walter Roberson 2016 年 5 月 18 日
Example:
f = @(x,y) sin(x.^2 + y.^2 - x*y); %a function of 2 variables
fixed_x = pi/9;
newf = @(y) f(fixed_x, y);
Now you can, for example,
ezplot(newf, [-20, 15])

その他の回答 (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