~ means NOT so *isempty* tells you if the vector is empty and *~isempty* tells you if the vector is _not_ empty. Answer from Adam on mathworks.com
๐ŸŒ
MathWorks
mathworks.com โ€บ matlab โ€บ language fundamentals โ€บ matrices and arrays
isempty - Determine whether array is empty - MATLAB
TF = isempty(A) returns logical 1 (true) if A is empty, and logical 0 (false) otherwise. An empty array, table, or timetable has at least one dimension with length 0, such as 0-by-0 or 0-by-5. ... Create a 3-D array with one dimension length equal to zero, and determine if it is empty.
Discussions

How can I use an empty matrix in a logical if statement?
How can I use an empty matrix in a logical if... Learn more about logical operator, if, empty matrix, isempty, [] MATLAB More on mathworks.com
๐ŸŒ mathworks.com
2
2
January 22, 2014
How to check if an array is empty without using any built in functions
How to check if an array is empty without using... Learn more about matrix array More on mathworks.com
๐ŸŒ mathworks.com
2
0
September 4, 2021
Why does isempty return false?
Is TEST a cell array? If so use {} to get at the contents (C-urly for C-ontents). The return value {[]} is not empty because it is a length one cell array - the contents of the cell array is an empty array. More on reddit.com
๐ŸŒ r/matlab
8
0
September 1, 2015
isempty function does not work for me
isempty function does not work for me. Learn more about cell arrays, arrays, empty More on mathworks.com
๐ŸŒ mathworks.com
1
0
April 9, 2021
๐ŸŒ
RDocumentation
rdocumentation.org โ€บ packages โ€บ matlab โ€บ versions โ€บ 1.0.4.1 โ€บ topics โ€บ isempty
MATLAB isempty function
matlab (version 1.0.4.1) Determine if object is empty. isempty(A) Returns TRUE if x is an empty object; otherwise, FALSE. A ยท object to evaluate ยท P. Roebuck proebuck1701@gmail.com ยท An empty object has at least one dimension of size zero. Run this code ยท
๐ŸŒ
MathWorks
mathworks.com โ€บ mapping toolbox โ€บ data analysis โ€บ vector data
isempty - Determine if geographic or planar vector is empty - MATLAB
isempty(gp2) ans = logical 0 ยท collapse all ยท Geographic or planar vector, specified as a geopoint, geoshape, mappoint, or mapshape object. collapse all ยท Flag indicating geographic or planar vector is empty, returned as a logical scalar. tf is True when v is empty. Data Types: logical ยท Introduced in R2012a ยท You clicked a link that corresponds to this MATLAB command: Run the command by entering it in the MATLAB Command Window.
Find elsewhere
๐ŸŒ
MathWorks
mathworks.com โ€บ system identification toolbox
isempty - Determine whether dynamic system model is empty - MATLAB
Where sys is a model array, isempty(sys) returns 1 when the array has empty dimensions or when the LTI models in the array are empty.
๐ŸŒ
Reddit
reddit.com โ€บ r/matlab โ€บ why does isempty return false?
r/matlab on Reddit: Why does isempty return false?
September 1, 2015 -

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.

๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 797582-isempty-function-does-not-work-for-me
isempty function does not work for me - MATLAB Answers - MATLAB Central
April 9, 2021 - I believe the correct way to use "isempty" is to call "isempty(out1)". Here is the sample code: ... https://www.mathworks.com/matlabcentral/answers/797582-isempty-function-does-not-work-for-me#comment_1450197
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 378004-why-is-an-empty-string-not-empty-isempty-returns-true-but-isempty-returns-false
Why is an empty string not empty? isempty('') returns true, but isempty("") returns false - MATLAB Answers - MATLAB Central
January 19, 2018 - Presumably "" is not empty because it is a string object, while '' really is the same as [ ]. But this is a problem for code that tests for empty character input using isempty(...). It no longer works as expected if passed "" instead of ''. Is there a switch we can turn on or off to enable isempty("") to return true? A function written prior to R2016b never needed to check for empty "" (double-quoted) strings, because Matlab would throw an exception if passed something in double quotes.