.mat to csv

8 次查看(过去 30 天)
prashant singh
prashant singh 2017-11-14
回答: KL 2017-11-14
i have a mat file which has 5 cells.Each cell has 16 rows. i want them to write it into csv files where each column of csv contains each cell value i.e total 16*5 for csv files. I have tried csvwrite function but i got the error:
Undefined function 'real' for input arguments of type 'struct'.
Error in dlmwrite (line 189)
str = sprintf('%.*g%+.*gi',precn,real(m(i,j)),precn,imag(m(i,j)));
Error in csvwrite (line 42)
dlmwrite(filename, m, ',', r, c);
Attaching my mat file.

采纳的回答

KL
KL 2017-11-14
Well, your lbp cell array has a vector in each cell! Anyway, I'd prefer to create a table and then use writetable function like the following.
C = [Entropy feature lbp Mean name];
T = cell2table(C(2:end,:),'v',C(1,:));
writetable(T,'dummy1.csv')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Import, Export, and Conversion 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by