Hi everyone,
I am trying to merge the columns from many arrays. The files I have are named (i)_MID.mat and contain five variables: N, P1, P2, R1, R2. Each of them have 3 columns and 10 rows. I would like to create a large vertically merged array of the N variables of all .mat files I have, ending with a 260 x 3 array, naming RT, Hit, Stim, to the columns of this array. I am working with this:
% Number of files to merge.
subjects = 26;x=[]; % start w/ an empty array
for i=1:subjects files = [num2str(i) '_MID.mat']; x= vertcat(load(files));endsavename = 'mergedarray';save(savedname ,'x');
However, the file generated contains an array of 26×5 and in each cell has a 10×3 array. I want to generate an array of 260×3 for each condition, ideally (named as N_merged, P1_merged, etc). If this is not possible, an array of 260×15 (what I intended in the code above). Can you point me what I am doing wrong in this approach to achieve the goal. I attached 3 examples of the data, in case is necessary, as well as the output I am getting so far. Hopefully my explanation makes sense.
Many thanks
Best Answer