MATLAB: Condition and xlsread

xlsread

Hallo,
how can i put xlsread to condition?
If label (value) doesn´t exist that it do something.
For example:
if(xlsread(excel,'7.1_1_a',sprintf('AC%d',j))==??? || xlsread(excel,'7.1_1_u',sprintf('AC%d',j))==??? || xlsread(excel,'7.1_1_i',sprintf('AC%d',j))==???)
lol = 0;
else
script2 (excel);
end

Best Answer

I think that if you're simply looking to see if there is data in the cell, you can just use the ISEMPTY function. Something like this:
xlswrite('test.xls',magic(2))
if isempty(xlsread('test.xls','Sheet1','A4'))
disp('The cell is empty')
else
disp('The cell contains a value')
end
Although, it would probably be better, since you're using XLSREAD anyway, to read the data into a variable.
What is your goal? Maybe I can be of more help if I better understand what you are trying to do.