필터 지우기
필터 지우기

Retrieve cell of matrices from text file

조회 수: 1 (최근 30일)
Divij Gupta
Divij Gupta 2021년 6월 24일
답변: Mathieu NOE 2021년 6월 25일
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?

답변 (1개)

Mathieu NOE
Mathieu NOE 2021년 6월 25일
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);

카테고리

Help CenterFile Exchange에서 Data Import and Export에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by