Effacer les filtres
Effacer les filtres

How to convert a cell vector with numbers and non-numbers into a comma-seprated (.csv) format?

2 vues (au cours des 30 derniers jours)
Hi,
I have the cell array:
Matrix(1,1) = {'ABCD'}
Matrix(1,2) = {'*'}
Matrix(2,1) = {'251'}
Matrix(2,2) = {'0'}
Matrix(3,1) = {'*'}
Matrix(3,2) = {'01/12/2001'}
I need to export a csv (I guess using csvwrite function) with this format:
ABCD,*
251,0
*,01/12/2001
Someone can help me? Many thanks!

Réponse acceptée

Julia Antoniou
Julia Antoniou le 26 Jan 2018
Hi Adriano,
You could accomplish this with the following commands:
T = cell2table(Matrix);
writetable(T,'filename.csv','WriteVariableNames',false);
See this documentation page for more information about the "writetable" function.

Plus de réponses (0)

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by