I want to save a cell of 1 x 2000 of matrices 20 x 500 done in matlab in a h5 file and then load it in python. I couldn't save it in matlab. Is there any solutions for this ? Here is the code I use to save but it doesn't work with cells.
for i = 1:length(idxtrain)
x_train{i} = image_array_prec{idxtrain(i)}(:,:,1);
end
for i = 1:length(idxtest)
x_test{i} = image_array_prec{idxtest(i)}(:,:,1);
end
%%
savefileh5 = 'traintest.h5'
%%
try
h5create(savefileh5,'/train/x_train',[size(x_train,1) size(x_train,2)]);
h5write(savefileh5,'/train/x_train',x_train);
catch ME
warning('File already in folder');
end
%%
x_train1 = h5read(savefileh5,'/train/x_train');