Let I have dataset with 4 variable = c1, c2, c3, c4 from 3 observations. I want to make a conclusion in this 3 observation based on the "IF" condition (I wrote this IF condition in excel):
=IF(AND(C1>C2,C1>C3,C1>C4),1,IF(AND(C2>C1,C2>C3,C2>C4),2,IF(AND(C3>C1,C3>C2,C3>C4),3,4)))
c1 c2 c3 c4 conclusion 0.05000 0.77426 0.07760 0.39404 ? 0.99888 0.32245 0.00001 0.00003 ? 0.99999 0.00000 0.00110 0.00000 ?
Note: in matlab there is no c1,c2,c3,c4 but column: 1,2,3,4
Can some one help me, how to write the code of this problem in matlab? many thanks!
Best Answer