'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])
다음과 같이 떳습니다. 어떻게 하면 위 문제를 해결할 수 있나요? 도와주시면 감사하겠습니다.

 Accepted Answer

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

More Answers (1)

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

2 Comments

It's not work...... I think I misunderstand your answer. please teach me one more time.
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?

Sign in to comment.

Tags

No tags entered yet.

Asked:

on 2 Nov 2015

Commented:

on 3 Nov 2015

Community Treasure Hunt

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

Start Hunting!