I'm working with a few matrices and trying to simplify the results involving symbolic terms. The subs() command won't work because there are no values assigned to the variables. But it's nasty trying to work with this:

(5592405333333333*u11)/4194304 - (5592405333333333*u9)/4194304

(1977213867171907*2^(1/2)*u5)/4194304 + (1977213867171907*2^(1/2)*u6)/4194304 - (1977213867171907*2^(1/2)*u9)/4194304 - (1977213867171907*2^(1/2)*u10)/4194304

The u values are symbolic. Evaluating the first term, (5592405333333333*u11)/4194304, is very near to 1,333,333,333*u11 which I can work with.

Is there some command to do the division so that it gets a bit cleaned up?


The command you're looking for is vpa. An example:

syms u11;
expr =(5592405333333333*u11)/4194304;  %fraction
res1 = vpa(expr);    %it'll evaluate expr to at least 32 significant digits
res2 = vpa(expr,5);  %it'll evaluate expr to at least 5 significant digits
res3 = vpa(expr,9);  %it'll evaluate expr to at least 9 significant digits


res1 =

res2 =

res3 = 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.