MATLAB: I do not want the output of the following program is a complex number

clc
a=[29580 -17580 0;-17580 35160 -17580;0 -17580 17580];
b=[30 0 0;0 30 0;0 0 20];
syms w
c=w*w*b;
d=a-c;
e=det(d);
f=solve(e)

Best Answer

Then just take the real part (because the imaginary part is very small)
f=real(double(solve(e)))