How to check if a json file is empty or not in matlab?

2 vues (au cours des 30 derniers jours)
Naresh  R A
Naresh R A le 11 Déc 2018
Commenté : KSSV le 11 Déc 2018
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.

Réponses (2)

madhan ravi
madhan ravi le 11 Déc 2018

KSSV
KSSV le 11 Déc 2018
s = jsondecode('["one", "two", "three"]')
if any(cellfun(@isempty,s))
disp('empty')
else
disp('not empty')
end
  7 commentaires
KSSV
KSSV le 11 Déc 2018
get the file info and get it size else..
KSSV
KSSV le 11 Déc 2018
f = dir(filename) ;
f.bytes

Connectez-vous pour commenter.

Produits


Version

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by