print in single line in matlab command line -


how print command line in matlab. output print statements in single line.

for example,

for i=1:4    disp(i)     => or others print statement! end 

output: 1234

not:

1

2

3

4

an option using fprintf

for i=1:4     fprintf('%d',i) end fprintf('\n') %//add line break @ end 

and if want linebreaks @ specific points use \n escape sequence , allows formatting such spacing:

for i=1:12     fprintf('%10d',i)     if mod(i,3)==0         fprintf('\n');     end end 

Comments

Popular posts from this blog

Python Kivy ListView: How to delete selected ListItemButton? -

asp.net mvc 4 - A specified Include path is not valid. The EntityType '' does not declare a navigation property with the name '' -