Which of the following produces a false value?

Highlights
Follow


Poll is CLOSED

Poll

Which of the following produces a false value?

isempty( [ ] )
10%
isempty( { } )
13%
isempty( '' ) % 2 single quotes
13%
isempty( "" ) % 2 double quotes
24%
c = categorical( [ ] ); isempty(c)
18%
s = struct("a", [ ] ); isempty(s.a)
22%
1324 votes

Sign in to participate
the cyclist
the cyclist on 10 Apr 2024
First one of the quizzes I've missed (even though I use strings quite a lot). That was at least my second choice.
My (faulty) reasoning was that the category "empty set" might not be empty.
@goc3 has left me with an empty feeling inside on this one.
DGM
DGM on 2 Apr 2024
I admit, I had to actually double-check that. I never use strings, but I kind of expected the attack to come from my blind spot.
Rik
Rik on 2 Apr 2024

My thought process was similar, although I also never use categorical.

Dyuman Joshi
Dyuman Joshi on 2 Apr 2024
Think of it like this -
What is the size of "12345"
What about "1234"
Now "123"
Then "12"
and "1"
Finally ""
(Credits to @Stephen23)
DGM
DGM on 2 Apr 2024 (Edited on 2 Apr 2024)
The way I thought about it was more like
What is the size of ["A" "B"]?
What about ["A" ""]?
... which really isn't all that different. Just reinforcing the notion of what a scalar string looks like.
goc3
Member of the Community Advisory Board since its inception | MATLAB enthusiast | Code optimizer | Software tester | Materials scientist / mechanical engineer by deg...
23
Posts
269
Replies
16
Followers

Tags

No tags entered yet.

Go to top of page