'Undefined function 'atan2' for input arguments of type 'sym'.'에러가 뜬는데 어떻게 해결해야되나요?

바터워즈 함수의 위상을 2~5차까지 구하기 위해서 다음과 같은 함수를 작성하였습니다.
syms w
clc;clear;
syms w
for m = 2:1:5
for n = 1:1:m
a(n)=(-1*sin(((2*n-1)*pi)/(2*m))+i*cos(((2*n-1)*pi)/(2*m)));
if n==1
F=1/(i*w-a(n));
else
F=F*1/(i*w-a(n));
end
end
ezplot(angle(F),[0,2.5])
hold on
grid on
end
그리고 결과는
Undefined function 'atan2' for input arguments of type 'sym'.
Error in angle (line 14)
p = atan2(imag(h), real(h));
Error in Untitled4 (line 13)
ezplot(angle(F)* 180/sym('PI'),[0,2.5])
다음과 같이 떳습니다. 어떻게 하면 위 문제를 해결할 수 있나요? 도와주시면 감사하겠습니다.

 採用された回答

Steven Lord
Steven Lord 2015 年 11 月 2 日

0 投票

The ANGLE and ATAN2 methods for symbolic objects were introduced in release R2013a according to the Release Notes. Are you using an earlier release?

1 件のコメント

paul
paul 2015 年 11 月 3 日
thanks about your help....

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

その他の回答 (1 件)

Image Analyst
Image Analyst 2015 年 11 月 2 日

0 投票

Instead of sym('PI') simply use pi
ezplot(angle(F)* 180/pi, [0, 2.5])

2 件のコメント

paul
paul 2015 年 11 月 2 日
編集済み: paul 2015 年 11 月 2 日
It's not work...... I think I misunderstand your answer. please teach me one more time.
Image Analyst
Image Analyst 2015 年 11 月 2 日
Why does your code say
ezplot(angle(F),[0,2.5])
while your error message says
ezplot(angle(F)* 180/sym('PI'),[0,2.5])
Please attach your actual script with the paper clip icon. Also, what value do you expect "w" to be?

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

カテゴリ

タグ

タグが未入力です。

質問済み:

2015 年 11 月 2 日

コメント済み:

2015 年 11 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by