matrixA = rand(100,2)matrixB = zeros(100,1)a= 78.6b = 90.6c = 99.5d = 156.1 for i = 1:100 if matrixA(i,2) < 0 matrixB(i,1) = i/a*i else if matrixA(i,1) >=0 <= a matrixB(i,1) = b/c else if matrixA(i,1) > a <= b matrixB(i,1) = a/d*5 else if matrixA(i,1) > c <=d matrixB(i,1) = a*d*c else if martixA(i,1) >d matrixB(i,1) = 78/b*d end end end end end end
I cant get the code to peruse through all the else if statements. It will only peruse the first else if statement then skip the rest.
Best Answer