- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEncodeIntoJSONFormat.m
More file actions
Latest commit
21 lines (19 loc) · 569 Bytes
/
Copy pathEncodeIntoJSONFormat.m
File metadata and controls
21 lines (19 loc) · 569 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
C_data = jsonencode(C);
dir_path = uigetdir();
[filepath, name, ext] = fileparts(dir_path);
filename = fullfile(dir_path, 'test_C.json');
fid = fopen(filename, 'w');
fwrite(fid, C_data, 'char');
fclose(fid)
test_struct =struct;
column_names =B.Properties.VariableNames;
for i =1:length(column_names)
column = column_names{i};
test_struct.(column) = B.(column);
end
B_data = jsonencode(test_struct);
dir_path = uigetdir();
filename = fullfile(dir_path, 'test_B.json');
fid = fopen(filename, 'w');
fwrite(fid, B_data, 'char');
fclose(fid)