[ACCEPTED]-Displaying information from MATLAB without a line feed-disp
Accepted answer
The fprintf function does not add a line 7 feed unless you explicitly tell it to. Omit 6 the fid argument to have it print to the 5 Command Window.
fprintf('Doing stuff... ');
for i = 1:5
fprintf('%d ', i);
% do some work on that pass...
end
fprintf(' done.\n'); % That \n explicitly adds the linefeed
Using sprintf won't quite 4 work: it creates a string without a line 3 feed, but then if you use disp() or omit 2 the semicolon, disp's own display logic 1 will add a line feed.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.