# Evaluating symbolic fractions without assigning values to the symbolic variables in MATLAB?

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
``````

Output:

``````res1 =
1333333333.3333332538604736328125*u11

res2 =
1.3333e9*u11

res3 =
1333333333.0*u11
``````