cell2mat - problem with consistency of matrices
Ältere Kommentare anzeigen
Hello everyone,
I would have a question regarding the cell2mat function. My data are saved in a cell file with this kind of structure:
val(:,:,1) =
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
val(:,:,2) =
[4x1 double] [4x1 double] [4x1 double] [4x4 double] [4x4 double]
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
[] [] [] [] []
etc.
I would like to have acces to what is in the file, namely, the following data:
dataAss{ss,1,bloc} = ones(length(sequence(1,:)),1)*bloc; dataAss{ss,2,bloc} = sequence(2,:)'; dataAss{ss,3,bloc} = sequence(1,:)'; dataAss{ss,4,bloc} = actionsExecuted; dataAss{ss,5,bloc} = soundProduced;
save(fileNameAPPR, 'dataAss');
PS: "Ass" = Association, not the other meaning...
So, I wrote cell2mat(dataAss), but I have the following error: Error using cat Dimensions of matrices being concatenated are not consistent.
Error in cell2mat (line 125) m = cat(1,c{:});
Not sure I understand the mistake because I don't see the inconsistency.
Thank you for the help!
Emilie
1 Kommentar
What is a "cell file"? MATLAB does not have any data class "cell file", and does not (by default) handle any file formats known as "cell file".
Are you referring to either of:
- A cell array , one of the standard data classes in MATLAB, or
- a .mat file, which can be used to store workspace data, including cell arrays ?
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!