Filter löschen
Filter löschen

Condition and xlsread

2 Ansichten (letzte 30 Tage)
Pepa
Pepa am 17 Mär. 2011
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

Akzeptierte Antwort

Laura Proctor
Laura Proctor am 17 Mär. 2011
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.
  1 Kommentar
Pepa
Pepa am 17 Mär. 2011
Thank you.
I needed "isempty".

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by