Saving cells created using mat2cell
Afficher commentaires plus anciens
I break a large array called tdm into a set of smaller cells of dimensions Dx, Dy, Dz using the mat2cell command
cutPre = mat2cell (tdmPre, [Dx], [Dy], [Dz])
I can call these cells like this: cutPre {1,1,1}, cutPre {1,1,2} ... until cutPre {4,4,5}
I would like to save these cells as a .h5-file using the same numbers in the name (e.g. cutPre(1,1,1).h5) and tried the following loop to do that:
for i= 1:nx;
for j= 1:ny;
for k= 1:nz;
assignin('base', ['cutPre' num2str(i,j,k)], cutPre{i,j,k});
hdf5write('cutPre',num2str(i,j,k),'.h5','/cutPre{i,j,k}','cutPre',num2str(i,j,k));
end;
end;
end;
The assign command does not work for several input arguments. Any suggestions?
Réponse acceptée
Plus de réponses (1)
Julia
le 3 Sep 2014
0 votes
Catégories
En savoir plus sur Resizing and Reshaping Matrices dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!