i have a string like
sample1 = ['Software','UserName','Author'];
sample2 = ['Matlab','john','Author1'];
sample3 = ['c','wright','Author2'];
now i need to write to txt file in below format
sample output format
Software UserName Author
Matlab john Author1 c wright Author2
problem is not able to adjust whitespaces
No products are associated with this question.
sample1 = {'Software','UserName','Author'}; %NOT square brackets!
fprintf('%14s %-14s %14s\n', sample1{:});
The problem is not with the {} !!
sample1 = {'Software','UserName','Author'}; %NOT square brackets!
fid = fopen('YourOutput.txt', 'wt');
fprintf(fid, '%14s %-14s %14s\n', sample1{:}); %notice first argument!
fclose(fid);
@Walter: It seems like your comments have lost their context. Did somebody delete some other comments? If so, who and why?
0 Comments