MATLAB: Beginning Matlab simple text question

beginnerplotsettext;

I am using a textbox that will display updating information on a simple force calculator and I need to know what to add to this code to display the units at the end of the string (Newtons in this case). Thank you!
set(h,'string',num2str(ForceB)); %will display Force in Newtons

Best Answer

You can use the square brackets to concatenate two strings (or arrays, matrices, etc.) together. For example:
a = 'hello';
b = ' world';
c = [a b]; % c is the concatenation of a and b: 'hello world'
You just have to enclose your num2str in these square brackets and add the string for the units, similar to the above example.