Closed mtillman14 closed 12 months ago
Not only is it better for documentation and whatnot, it's also much faster to encode the MAT files as json, then just save the json files. Also faster on the flipside, when loading those json files and converting decoding them back to MAT files. See below code: % Encode the Digraph variable to json and save it to file. tic; plotJS=jsonencode(Digraph,PrettyPrint=true); fid=fopen('TestDigraphJSON.txt','w'); fprintf(fid,'%s',plotJS); fclose(fid); toc;
% Time to load the Digraph variable tic; load('Settings_Spr22RoleOfEachGaitPhase.mat','Digraph'); toc;
% Time to load the json of the Digraph, then convert it to struct. tic; text=fileread('TestDigraphJSON.txt'); Digraph2=jsondecode(text); toc;
SQL now
This will help with 1. Human readability, 2. GitHub syncing, 3. Future translation between MATLAB and Python, 4. Future-proofing.
Need to then interpret the variables that "jsondecode" creates in MATLAB because it will not be the exact same data types.