Saving cells created using mat2cell
Mostrar comentarios más antiguos
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?
Respuesta aceptada
Más respuestas (1)
Julia
el 3 de Sept. de 2014
0 votos
Categorías
Más información sobre Resizing and Reshaping Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!