X = [67;89;78;56;55;75;99];f = [4;5];for i = 1:length(X); if i == f; X1(i,1) = 5*X(i,1); else X1(i,1) = X(i,1); endend
I know that the way i have written the if expression is wrong but can someone tell how do I write the if expression such that it uses the values of f.. basically if i equals the value in the f matrix or array the first formula is used else the second.
Thanks for help.
Sid
Best Answer