MATLAB: Display a variable and its units

display

I know how to use the display(X) function to display a variable I have solved for. So, if my X = 25, and I need it to display 25 ft/lb, how would I do this?

Best Answer

Units are now in MATLAB if you have Symbolic Math Toolbox. Try this, and see the tutorial: https://www.mathworks.com/help/symbolic/units-of-measurement-tutorial.html:
>> u = symunit;
>> x = 2*u.meter
x =
2*[m]
>> x = rewrite(x,u.ft)
x =
(2500/381)*[ft]
>> double(separateUnits(x))
ans =
6.5617