How to do to display() appear as last thing

Hi, I've made a script that have some outputs and as my last sentence in this script I have:
disp(sprintf('Advice:'))
display(orderM1,'Order_model1');
display(orderM2,'Order_model2');
I want the answer to the above code appear as the last thing and not at first.
Thanks!

1 Comment

You should not be calling display() directly; you should be using disp(). Unless, that is, display() is your own routine that is not intended to be a class method invocation.
I am not sure what the "answer to the above code" is?

Sign in to comment.

 Accepted Answer

Instead of using disp(), sprintf(), and display() (whatever that is), just use fprintf():
fprintf('Advice:\nOrder_model1 = %f\n%Order_model2 = %f\n',Order_model1, Order_model2);

More Answers (0)

Categories

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!