i wish to calculate mean for every additional column (eg.for first row; calculate mean for column 1 store in (1,1), for column 2 calculate mean for first 2 columns store in (1,2), for column 3 calculate mean for first 3 columns store in (1,3) and so on) for each of my rows independently.
I have a 600×200 matrix (data) and I have tried using nested for loops so that the calculation is done for all 600 rows but my results are incorrect. grateful for any ideas. a part of my code looks like this;
m=600n=200for k=1:m for h=1:n Mean_answer(k,h)= mean(data(1:h)) end end
Best Answer