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?
Best Answer