Surf a function with different values

1 回表示 (過去 30 日間)
Alexandra Roxana
Alexandra Roxana 2023 年 5 月 21 日
コメント済み: Alexandra Roxana 2023 年 5 月 27 日
I'm trying to surf a function f that takes 2 values: 1 if (x,y) is in A and 2 if (x,y) is in B. How can I do that? I attach also a drawing for x,y.

採用された回答

Torsten
Torsten 2023 年 5 月 21 日
Define the function as
f = @(x,y) (y>=2*x) + 2*(y<2*x);
and make a surface plot.
  17 件のコメント
Alexandra Roxana
Alexandra Roxana 2023 年 5 月 23 日
編集済み: Alexandra Roxana 2023 年 5 月 23 日
Thank you for all your help!
Alexandra Roxana
Alexandra Roxana 2023 年 5 月 27 日
The method from the link seems to work; however I'm a bit confused with the values of n1, n2 and n3. I don't know what values I should put: if I put [1,1,1] the first coordinates are different, the rest is the same as should be. So I'm guessing the choice of n1, n2 and n3 is wrong.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGraphics Performance についてさらに検索

タグ

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by