When you perform computations using sym objects, MATLAB will not approximate the result of those computations as a double precision result normally. In order to approximate the results you need to either do something that requires the results to be double precision (like assigning the variable into an element of a double array) or explicitly tell MATLAB to approximate it using the double or vpa functions.
two = sym(2);
sqrt2 = sqrt(two)
x = 0;
x(1) = sqrt2
s2 = double(sqrt2)
s2_2 = vpa(sqrt2)
Note that sqrt2 is displayed as 2^(1/2) but x, s2, and s2_2 all display that quantity to a certain number of decimal places. The format function will not affect the display of sqrt2 or s2_2 but will affect the display of x or s2.
Best Answer