how to export multiple .mat files to csv using the automation script?
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Sandeep GNV
am 12 Aug. 2021
Kommentiert: Ola Fekry
am 21 Feb. 2022
i have multiple .mat files, each mat file consits of 2 datasets (Input and Output). i was successful to combine Inputs and Outputs in a single .mat file and convert it to .csv file.
>>load('mat_file1.mat');
%2 files are loaded in workspace (Input.mat 100x10 and Output.mat 100x10)
>>I/O_file1 = [Input Outpt];
%single MAT file created (I/O_file1.mat 100x20)
>>xlswrite('I/O_file1.csv', mat_file1.mat);
%CSV file created
But there are several MAT files in a single folder such as ( mat_file1.mat, mat_file2.mat, mat_file3.mat, mat_file4.mat, mat_file5.mat .....)
Now i need an Automation script so that i can convert all the MAT files present in the folder at once.
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Sandeep GNV
am 18 Aug. 2021
1 Kommentar
Rik
am 18 Aug. 2021
You can extend the data variable. You probably need to convert it to a cell array (if it isn't one yet) with num2cell. Then you can trivially add the header.
Siehe auch
Kategorien
Mehr zu Language Support finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!