'Undefined function 'atan2' for input arguments of type 'sym'.'에러가 뜬는데 어떻게 해결해야되나요?
Mostrar comentarios más antiguos
바터워즈 함수의 위상을 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])
다음과 같이 떳습니다. 어떻게 하면 위 문제를 해결할 수 있나요? 도와주시면 감사하겠습니다.
Respuesta aceptada
Más respuestas (1)
Image Analyst
el 2 de Nov. de 2015
Instead of sym('PI') simply use pi
ezplot(angle(F)* 180/pi, [0, 2.5])
2 comentarios
Image Analyst
el 2 de Nov. de 2015
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?
Categorías
Más información sobre Calculus en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!