Hi there,
I would like to ask how can I use multiple if statements. I have written the following code but I only get results for the first if statements.
for j = 1 : 2x = randn(10,1)for k=1:2y = randn(10,1)if j == 1 & k == 1 xlswrite('Test.xls', [x y], 'Test1', 'b2'); if j == 1 & k == 2 xlswrite('Test.xls', [x y], 'Test1', 'p2'); if j == 2 & k == 1 xlswrite('Test.xls', [x y], 'Test1', 'b20'); if j == 2 & k == 2 xlswrite('Test.xls', [x y], 'Test1', 'p20'); end end endendendend
I would appreciate any help. Thank you.
Best Answer