Complex Number resulted in DOUBLE cannot convert the input expression into a double array
Mostra commenti meno recenti
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 Commenti
Walter Roberson
il 14 Apr 2016
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
il 14 Apr 2016
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Numbers and Precision in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!