there is error in plotting, how to resolve it?

3 ビュー (過去 30 日間)
SYED
SYED 2024 年 5 月 6 日
編集済み: Dyuman Joshi 2024 年 5 月 6 日
how to plot this function f(x,y)=x^y
i am getting error because function is becoming undefined at 0^0 but how to resolve this case.
x and y limit is same from -10 to 10
so how can we plot a function in which there are some value which are undefined

回答 (1 件)

Matlab Pro
Matlab Pro 2024 年 5 月 6 日
Hi
I see no problem for Matlab to plot "undefined" value
1st of al 0^0 in Matlab is 1 (try for yourself...)
Undfined value can be divizion by 0
I am attaching a small simple example that has an undefined values @ x=20
The figure shows the asymptote @ x=20:
x = -1e2:1e2;
y = 1./(x-20); % an asymptote @ x=20
figure;
plot(x,y);
grid on
Please send your code, if this does not help...
  2 件のコメント
SYED
SYED 2024 年 5 月 6 日
then why this error
Dyuman Joshi
Dyuman Joshi 2024 年 5 月 6 日
編集済み: Dyuman Joshi 2024 年 5 月 6 日
"then why this error"
Because, as the error hints, some values of Z are complex.
mesh (or surf) does not accept complex values.
How will you plot a 3D curve (or a surface, for that matter) with complex values?

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

カテゴリ

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

タグ

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by