Initial commit

This commit is contained in:
Kasiaaaaaa committed 2026-09-22 11:52:03 +02:00
commit d89b82be4a
103 files changed
+23110

No files matched your search

+31
View File
@@ -0,0 +1,31 @@
#!/usr/bin/python
import json
from load_matrix import loadmat
from pymatreader import read_mat
import os
def main(f):
matFile = os.path.join(
"/home/nao/Documents/Backups/Participant results/Sam/", f)
mat = loadmat(matFile)
results = mat["results"]
jsonFile = os.path.join(
"/home/nao/Documents/Backups/Participant results/Sam/", os.path.splitext(f)[0] + ".json")
with open(jsonFile, 'w+') as fl:
fl.write(json.dumps(results, indent=4, sort_keys=True))
fl.close()
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('f', help='.mat file to be created into json')
args = parser.parse_args()
main(args.f)
print '--- Operation Completed ---'