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

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -