pmdav
pmdav

Reputation: 301

How to iterate over one of the columns of a table and write it to csv file

I have a table gTruth.LabelData and have a column called X. I want to iterate over the elements of the column X of the table, and write it into a csv file. How to do it?

The variables in each cell of the X column is of type double like [3 15 26 38;62 9 19 4].

Upvotes: 0

Views: 65

Answers (1)

PyMatFlow
PyMatFlow

Reputation: 478

L = size(X,2)   % number of column 

for i=1:L  
     valX = X(:,i) 
     xlswrite('MyFile.xlsx',valX)
end

Upvotes: 1

Related Questions