how to use MATLAB units ?
Show older comments
I need to use units in Matlab
To use Matlab units i use Mupad like this:
aux1 = evalin(symengine,'unit::convert(2.1*unit::volt, unit::mvolt)')
Which returns
2100.0*unit::mvolt
Is there any way to use units beside this hack , which is quite annoying ...
Accepted Answer
More Answers (2)
Walter Roberson
on 10 Mar 2016
0 votes
Other than switching to feval() syntax, No.
5 Comments
timo
on 13 Mar 2016
Walter Roberson
on 13 Mar 2016
V = sym('unit::volt');
mV = sym('unit::mvolt');
aux1 = feval('symengine', 'unit::convert', 2.1 * V, mV)
timo
on 14 Mar 2016
Walter Roberson
on 15 Mar 2016
aux1 = feval(symengine, 'unit::convert', 2.1 * V, mV)
Categories
Find more on Utilities for the Solver in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!