- Json文件读取
txtJson = fileread(jsonPath);
hisjson = jsondecode(txtJson );
下面就可以以hisjson.域的形式,引用json文件内的字段了
- json文件的创建
contxt = jsonencode(结构体变量名称)
fp = fopen(filepath,'w');
fprintf(fp,'%s',contxt );
fclose(fp);
txtJson = fileread(jsonPath);
hisjson = jsondecode(txtJson );
下面就可以以hisjson.域的形式,引用json文件内的字段了
contxt = jsonencode(结构体变量名称)
fp = fopen(filepath,'w');
fprintf(fp,'%s',contxt );
fclose(fp);