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

3 visualizzazioni (ultimi 30 giorni)
Naresh  R A
Naresh R A il 11 Dic 2018
Commentato: KSSV il 11 Dic 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.

Risposte (2)

madhan ravi
madhan ravi il 11 Dic 2018

KSSV
KSSV il 11 Dic 2018
s = jsondecode('["one", "two", "three"]')
if any(cellfun(@isempty,s))
disp('empty')
else
disp('not empty')
end
  7 Commenti
KSSV
KSSV il 11 Dic 2018
get the file info and get it size else..

Accedi per commentare.

Prodotti


Release

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by