I try to solve a system of symbolic equations, and the result is far more accurate than I actually need. In fact, 3-digits should be relatively good enough for me while it ends up offering 32 digits, which takes too long as I need to repeat the process hundreds of times. Is there any way to reduce the solve accuracy?
syms x y z t 'real'warning('off')line_p=[3,2,1]; % point on the line
line_d=[1,2,3]; % line direction
surf=x+y^2+z^3-10;[x,y,z]=itsct_solve(line_p,line_d,surf)function [x,y,z]=itsct_solve(line_p,line_d,surf)syms x y z t 'real'eq1=x-line_p(1)+line_d(1)*t; eq2=y-line_p(2)+line_d(2)*t;eq3=z-line_p(3)+line_d(3)*t;eq4=surf;[x,y,z,t]=solve(eq1==0,eq2==0,eq3==0,eq4==0,'x','y','z','t');x=vpa(x);y=vpa(y);z=vpa(z);t=vpa(t);end
Best Answer