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.5617