matlab - Saving a three-dimensional matrix as multiple two-dimensional .mat files -


suppose have three-dimensional matrix called a.

i save a(1,1:n,:), a(2,1:n,:), a(3,1:n,:) etc. separate two-dimensional .mat files: squeeze(a(1,1:n,:).

i'm guessing there might easy way go i'm not aware of.

thank much!

see comment define , assign variables programmatically. however, don't need here. suggest, loop

for = 1 : 5     b = squeeze(a(i, 1 : n, :);     save(['slice', num2str(i), '.mat'], 'b'); end 

and assign 1 variable write different files.


Comments

Popular posts from this blog

c++ - CryptStringToBinary API behavior -

java.util.scanner - How to read and add only numbers to array from a text file -

iphone - Three second countdown in cocos2d -