This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% To check if struct has any fields, | |
% fieldnames function can use that return cell with | |
% strings representing fields names if any | |
% | |
s = struct(); | |
if numel(fieldnames(s)) == 0 | |
disp('No fields'); | |
end | |
s = struct([]); | |
if numel(fieldnames(s)) == 0 | |
disp('No fields'); | |
end | |
s = struct(); |