Azzera filtri
Azzera filtri

Retrieve cell of matrices from text file

1 visualizzazione (ultimi 30 giorni)
Divij Gupta
Divij Gupta il 24 Giu 2021
Risposto: Mathieu NOE il 25 Giu 2021
I have a cell X such that X{i} is a 10x10 matrix. There are about 500 of these matrices. I am using writecell(X,"textfile") to write the cell contents to a text file. However when I retrieve the data as C = readcell("textfile"), C{1} is no longer a matrix but a single number. How do I retrieve the data properly?

Risposte (1)

Mathieu NOE
Mathieu NOE il 25 Giu 2021
hello
my suggestion :
C is same as X now
X{1} = rand(10,10);
writecell(X,"textfile");
C{1} = reshape(cell2mat(readcell("textfile")),10,10);

Categorie

Scopri di più su Data Import and Export in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by