MATLAB: Graphing and converting sym p to long (or double) p.

symSymbolic Math Toolbox

>>x=linspace(-1,1,100) >>p = 1/26 + 25/26*x- (25/26*x-25/26)*x + ((625/1313*x-1250/1313)*x-625/1313)*x >> plot(x,double(p))
??? Error using ==> eval Undefined function or variable 'x'. Error in ==> sym.double at 45 D = reshape(eval(X),siz);
Questions: (1) How do I convert sym x (lower case variable x) to long (because I wanted it to be to the 16th decimal places)? (2) How do I get this Polynomial expression called 'p' to graph along a linspace between -1 and 1 of 100 intervals between them?

Best Answer

Thank you so much. You answered 2 questions in 1 command. You R-O-C-K!!!