Complex Number resulted in DOUBLE cannot convert the input expression into a double array
이전 댓글 표시
I have done some digging and searching, but I cannot find solution for the particular error. I suspect it is the i acting as symbolic, but I am not sure. Below shows the code and the output. Please help me resolve this issue! Thank you!
Code:
A = [0 1
-2 -3];
B=[0
1];
tr = 0.5;
po = 0.05;
%zeta, omega, and z, w are to calculate damping and natural frequency
syms zeta omega;
[z, w] = solve([tr == (2.16 * zeta+0.6)/omega, po == exp(-1 * zeta * pi / sqrt(1-zeta^2))], [zeta, omega]);
z = vpa(z,4)
w = vpa(w,4)
Poles = [-z*w+w*sqrt(z^2-1) -z*w-w*sqrt(z^2-1)]
place(A,B,Poles)
Output (error occurs at place):
Error using symengine
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use VPA.
댓글 수: 2
Walter Roberson
2016년 4월 14일
Please show the complete error message.
One thing to remember is that vpa() does not convert the value to double precision, so your z and w stay symbolic after the vpa()
Eric Wang
2016년 4월 14일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Numbers and Precision에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!