MATLAB: Ao can I display a var-comment-var

MATLAB

I have two variables like A and B, now I need to print in command window variable1-comment-variable2 how can I do this?

Best Answer

If A and B are numbers, you can use
disp([num2str(A) ' my comment in between ' num2str(B)])
Related Question