Hi, I am new to MATLAB and I can't seem to figure out how to graph a two variable limit like:
I've seen answers on how to create a two-variable function, or how check the limit for continuity, but I hope to see it graphed in relation to . I have gotten errors saying that the function is too complex, or that Z must be a matrix, and I have no clue how I should handle those kinds of errors.
Thanks in advance for any help that is given!

1 件のコメント

Torsten
Torsten 2022 年 10 月 7 日
編集済み: Torsten 2022 年 10 月 7 日
What do you want to graph here ? The function is defined and continuous at (0,1) with value (acos(0))/1 = pi/2.

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

 採用された回答

Chunru
Chunru 2022 年 10 月 7 日

1 投票

x= -0.5:.01:0.5;
y = 0.5:.01:1.5;
[xx, yy] = meshgrid(x, y);
zz = acos(xx./yy)./(1+xx.*yy);
%zz = nan(size(xx));
% idx = abs(xx./yy)<=1;
% zz(idx) = acos(xx(idx)./yy(idx))./(1+xx(idx).*yy(idx));
% whos
contourf(xx, yy, zz);
hold on
plot(0, 1, 'rd')

4 件のコメント

Stephen
Stephen 2022 年 10 月 7 日
Thanks, that answer works, but I should of mentioned that I hoped to graph the function using something like mesh(), sorry about that.
I've tried:
x=-3:0.1:3;
y=-3:0.1:3;
[x,y]=meshgrid(x,y)
z = (acos(x./y))/((1+x.*y));
mesh(x,y,z)
but due to it being a limit it returns:
from the discontinuity.
Is it possible at all to represent that using a mesh (or any 3D graphing functions for that matter) or no due to the discontinuity?
Thank you again for the help!
Torsten
Torsten 2022 年 10 月 7 日
編集済み: Torsten 2022 年 10 月 7 日
There is no problem with the point (0,1). It's a point of continuity - the function is even analytic there.
The only thing to remember in a graphical representation is that x must be smaller than y since acos(z) is real-valued only for abs(z) <= 1.
Stephen
Stephen 2022 年 10 月 7 日
I understand that, I was just asking the wrong question originally and got the correct answer anyways, which is my fault on my part. Thank you both for the help anyways, sorry about the confusion!
Chunru
Chunru 2022 年 10 月 7 日
The comment-out code above is good when acos become complex.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMathematics についてさらに検索

製品

リリース

R2022a

タグ

質問済み:

2022 年 10 月 6 日

コメント済み:

2022 年 10 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by