Reputation:
I had this code to output columns of data:
interestRow =table(Position,Hertz,Auxiliary_Channel_Power,Main_Channel_Power);
writetable(interestRow,auxiliaryData,'Delimiter','\t','WriteRowNames',true);
However, the cluster I'm working on does not have a new version of Matlab, so I can't use table. How can I use fprintf to print out columns? What I have right now is:
fprintf('%f \t %f \t %f\t%f\t',Position,Hertz,Auxiliary_Channel_Power,Main_Channel_Power);
But it's not working. And are there any other better methods that work on older versions of Matlab?
Upvotes: 1
Views: 39
Reputation: 7929
Firstly you can create a matrix from all the data:
total_matrix = [Position,Hertz,Auxiliary_Channel_Power,Main_Channel_Power];
Then you can write it to a file:
dlmwrite(filename,total_matrix, 'delimiter','\t','precision',3 );
Upvotes: 1