MATLAB: How to set a unit to variable cmmmunit I encounter the error after run this : 30*unit::mm Best Answer Units are now in MATLAB if you have Symbolic Math Toolbox. Try:>> u = symunit; >> x = 2*u.meter x = 2*[m]>> x = rewrite(x,u.ft) x = (2500/381)*[ft]>> double(separateUnits(x)) ans = 6.5617See the tutorial: https://www.mathworks.com/help/symbolic/units-of-measurement-tutorial.html Related SolutionsMATLAB: How to use MATLAB units Starting R2017a, units are available in MATLAB via Symbolic Math Toolbox. See:https://www.mathworks.com/help/symbolic/units-of-measurement-tutorial.htmlKaran. (Symbolic doc)[SL: fixed typo.] MATLAB: Can physical units be associated with MATLAB variables Starting from MATLAB R2017a, physical units can be associated with variables in MATLAB via Symbolic Math Toolbox. Please refer to the following links for more information on how to use it:https://www.mathworks.com/help/symbolic/units-of-measurement.htmlhttps://www.mathworks.com/help/symbolic/modeling-the-velocity-of-a-paratrooper.html Related QuestionDisplay a variable and its unitsHow to add units to a number and differentiate between different inputsArithmetic operations with unitsMupad and R2019a
Best Answer