Effacer les filtres
Effacer les filtres

How to print the element of a cell into a text file?

1 vue (au cours des 30 derniers jours)
Mnr
Mnr le 28 Mar 2014
Commenté : Mnr le 28 Mar 2014
Hello all,
I have a 1X8 cell array with all its elements are 1X300 cells and each of those 300 cells are 4X1 doubles. I would like to print the cell array into a .txt file. I would appreciate if somebody can help me please. Thanks.

Réponse acceptée

Azzi Abdelmalek
Azzi Abdelmalek le 28 Mar 2014
If A is your cell array
M=cell2mat(cellfun(@(x) cell2mat(x),A','un',0))
dlmwrite('file.txt',M)
  1 commentaire
Mnr
Mnr le 28 Mar 2014
I really appreciate it! Thank you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

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

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by