Hi, my excel file (Book2) contains 20×3 arrays with integer values. I want to run the following 'for loop' and 'if loop' with logical operations on Matlab and then write 'string' values in a new column of the same excel file. Please help me to correct the code. Thanks.
F = xlsread('Book2.xlsx');
N = length(F(:, 2));
for i = 1 : N
if ((F(i, 2) >= 7 && F(i, 2) < 27) && (F(i, 3) >= 28 && F(i, 3) < 50) && (F(i, 1) <= 52))
xlswrite('F.xlsx', (i, 4), {'Loam'});
else
xlswrite('F.xlsx', (i, 4), {'Null'});
end
end
Best Answer