I have 360 archives.mat, each with a variable 'A', of size 1800x400x1. I would like to concatenate these arrays in the third dimension, ie I would like an 'A1' of size 1800x400x360. For this I tried two things: 1) I used the 'cat' command (as in the code below), but it just saved the last array:
d=dir('test/*.mat');%test is the name of my directory where these files are stored
nn=length(d); A1=[]; for ii=1:nn eval(['load teste/',d(ii).name]) disp(d(ii).name) A1=cat(3,A); end
2) I tried to use [], but it only concatenates in the first or second dimension:
d=dir('test/*.mat'); nn=length(d); A1=[]; for ii=1:nn eval(['load test/',d(ii).name]) disp(d(ii).name) A1=[A1;A]; end
Anyone have any suggestions on how to solve this? Thanks.
Best Answer