How to check if an array is empty without using any built in functions
Show older comments
x = [];
x == [] , gives 0×0 empty logical array...
Accepted Answer
More Answers (1)
Sulaymon Eshkabilov
on 4 Sep 2021
x=[];
[R,C]=size(x)
if R==0 & C==0
disp('Empty')
else
disp('Contains STH')
end
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!