Problem using num2cell!

4 visualizzazioni (ultimi 30 giorni)
BN
BN il 6 Nov 2022
Commentato: BN il 6 Nov 2022
Hi, I wanted to split the contents of “A” into separate cells of “C”, where the third dimension of “A” including in each cell. Although num2cell work with no error, the results are wrong!
C = num2cell(A,3);
So far so good, but in the arrays of C, every 1x1x444 cell array contains repetitious values, which is wrong!
C{1,1}
val(:,:,1) =
18.6770
val(:,:,2) =
18.6770
val(:,:,3) =
18.6770
val(:,:,4) =
18.6770
.
.
.
val(:,:,444) =
18.6770
This is the same for other arrays for example C{1,2}, C{2,3}, etc.
I checked the script using another dataset (namely itsok.mat, and it worked properly).
I attached both of my datasets. The A.mat is the file I have a problem with, while the itsok.mat file is the dataset that is ok with the script.
Thank you all.

Risposta accettata

Walter Roberson
Walter Roberson il 6 Nov 2022
A(:,:,2) - A(:,:,1)
is all zero. So is A(:,:,15) - A(:,:,9) and all other possibilities.
nnz(diff(A,[],3))
is zero. Your third dimension of your array is bit-for-bit copies of your first plane.

Più risposte (0)

Categorie

Scopri di più su Large Files and Big Data in Help Center e File Exchange

Prodotti


Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by