MATLAB: Equations instead of plain values (roots)

problem value display equation

Hello, my question is: Why does Matlab show me proper values but in a form of equations?
Preview:
F =
133/2 - (3^(1/2)*(- 4116459*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - 130485*6^(1/2)*(532506243 + 3^(1/2)*334349677327873^(1/2)*175i)^(1/2) + 8046*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2))^(1/2))/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)*(36207*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/3) + 9*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(2/3) + 37048131)^(1/4)) - (4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2)/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6))
133/2 + (3^(1/2)*(- 4116459*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - 130485*6^(1/2)*(532506243 + 3^(1/2)*334349677327873^(1/2)*175i)^(1/2) + 8046*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2))^(1/2))/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)*(36207*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/3) + 9*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(2/3) + 37048131)^(1/4)) - (4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2)/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6))
(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2)/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)) - (3^(1/2)*(- 4116459*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) + 130485*6^(1/2)*(532506243 + 3^(1/2)*334349677327873^(1/2)*175i)^(1/2) + 8046*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2))^(1/2))/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)*(36207*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/3) + 9*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(2/3) + 37048131)^(1/4)) + 133/2
(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2)/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)) + (3^(1/2)*(- 4116459*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) + 130485*6^(1/2)*(532506243 + 3^(1/2)*334349677327873^(1/2)*175i)^(1/2) + 8046*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2) - ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3)*(4023*((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(1/3) + ((3^(1/2)*334349677327873^(1/2)*525i)/2 + 1597518729/2)^(2/3) + 4116459)^(1/2))^(1/2))/(2*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/6)*(36207*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(1/3) + 9*(1597518729/2 + (3^(1/2)*334349677327873^(1/2)*525i)/2)^(2/3) + 37048131)^(1/4)) + 133/2
Why do I have to solve each equation to get a value instead of having (for example) a value of 3.7054 for the first element of the vector F? I tried to use commands from my code just in the command window and I got value in an expected form.
Here's my code:
function [ r,l,n ] = potegowa( A,eps,maxIter )
%UNTITLED5 Summary of this function goes here
% Detailed explanation goes here
%eps=10^-6;
%A=[22,21,-8,4; 21,49,11,39; -8,11,60,-19; 4,39,-19,135];
r=0;
err=1;
[wym1 wym2]=size(A)
t=rand(wym1,1);
for n=1:maxIter
tp=t;
t=A*t;
rp=r;
r=norm(t)/norm(tp);
t=t/norm(t);
if eps>abs(r-rp)
break
end
end
syms lam
B=A-lam.*eye(wym1)
C=det(B)
D=coeffs(C)
E=fliplr(D)
F=roots(E)
I'm looking forward to seeing any tips! Thanks

Best Answer

They are not ‘equations’. They are symbolic quantities. To convert them to double values, use the double function:
F = double(roots(E))
The imaginary parts are negligible in this example, so consider using:
F = real(double(roots(E)))