Hello,
I was wondering how I could change my variable 'x' to type double from syms. I've tried converting it to type double with x=double(x) and nothing has happened.
Help would be very appreciated!
U = [3,2,1; 0,1,2; 0,0,1]b = [0;0;0]x=backsub(A,b)function x = backsub_syms(U,b)n = length(b);syms tx=sym(zeros(n,1))x(n)=sym('t')b=(sym(b))for i = n:-1:1 x(i)=b(i); x(n)=sym('t') if i<n for j = n:-1:i+1 x(i)=x(i)-U(i,j)*x(j); end end x(i)=x(i)/U(i,i);endend
Thanks for the help much appreciated!
Best Answer