I have loaded certain arrays in matlab and I want to take means and stuff, but my problem is that 'M' which is a variable( it is in the code that i have attached) is treated as a char rather than as an array(which it actually is). How to make use of M, the array instead of M, the char?
kk=[];
files = dir('*.dat');
for i=1:length(files)
    eval(['load ' files(i).name])
    M=files(i).name;
    load(M)
    p=mean(M,2);
    kk=[kk p];
end
mn= mean(kk,2);
 
     
     
    