There are two points to note:
1. The piece of code below will overwrite Temporal's existing value at different values of i (with value of RP_c). Instead from your question, I gather that your requirement is to concatenate the value of Temporal with the i'th column of RP_c
if i==8 || i==13 || i==3 || i==4 || i==9 ||i==14
Temporal=[RP_c];
end
In order to concatenate the values, do take a look at this link . Your code would look something like this:
if i==8 || i==13 || i==3 || i==4 || i==9 ||i==14
Temporal =[ Temporal RP_c(:,i) ];
end
2. With respect to your statement:
If I use "mean" only one value comes up but I want one value for each column of the matrix.
Once the values are filled up and you get a matrix with N columns, you can calculate the mean of each column using the mean function.
>> x = rand(50,5);
>> Y = mean(x)
Y =
0.5413 0.5499 0.4918 0.4321 0.5170
Hope this helps.