There is actually nothing wrong with isempty.
You could use this approach to get it a little less cumbersume:
list1 = [1, 1];
list2 = [2, 2, 2];
list3 = [3, 3, 3, 3];
list4 = [];
yesno = all(~cellfun(@isempty, {list1,list2,list3,list4}))
If you don't mind reorganizing your data, it is a really handy option:
lists{1} = [1, 1];
lists{2} = [2, 2, 2];
lists{3} = [3, 3, 3, 3];
lists{4} = [];
yesno = all(~cellfun(@isempty,lists))
The combination of cellfun and isempty is supposed to be really fast, though I'm lacking the source for this statement right now.
Short: No, there isn't and ~isempty() is fine coding. You could shorten it slightly by
yesno = ~isempty(l1)*~isempty(l2)*~isempty(l3)
cheers
I am fairly new to MatLab and am using it to inspect an array of strings to determine whether each element contains a string (specifically, the letter 'a'). When prompting isempty(strfind(TEST(1), 'a')), where TEST(1) does not contain an 'a', it returns FALSE (i.e. 0).
strfind(TEST(1), 'a') returns {[]}
Any help resolving this issue and possibly helping me understand why the result is not TRUE (i.e. 1)?
Edit: Wow thank-you for all of the thorough responses. I'll get back to working on my project tomorrow at work. This looks to be a very supportive community - although the submitted posts seem to get downvoted a lot.