Hi all,
For the matrix A (see attached), my goal is to calculate the mean of each row in the fifth column with the following conditions :
If for the column 1 to 4, values are superior to 0,84 , calculate the mean of the four columns.
If for the column 1 to 4, values are not superior to 0,84 (for instance if column 3 = 0,76), calculate only the mean of the first, second and four columns.
I reach the loop for the first case but I'm not able to do that for the second case….
Here are the few lines I've started to write :
for i=1:100 if A(i,1:4)>0.85 A(i,5)=mean(A(i,1:4)); else if (I have a doubt for this condition) A(i,1) or A(i,2) or A(i,3) or A(i,4) < 0,85 (I have a doubt for this line) ................................................................ endend
Thanks in advance for your help,
Louise
Best Answer