How to check if a json file is empty or not in matlab?
3 views (last 30 days)
Show older comments
I am reading the json file using jsondecode function.
i need to check if the json file is empty or not. If empty, display error message.
0 Comments
Answers (2)
KSSV
on 11 Dec 2018
s = jsondecode('["one", "two", "three"]')
if any(cellfun(@isempty,s))
disp('empty')
else
disp('not empty')
end
7 Comments
See Also
Categories
Find more on JSON Format 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!