Exporting multiple CSV's
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Aldo Amaya
am 1 Jul. 2014
Kommentiert: Aldo Amaya
am 2 Jul. 2014
This is a script that analysis various data parameter and it saves them by each test that was ran.
After each experiment there will always be the following matrix's and figure that need to get exported to the rest of the group. Is there a way to avoid renaming each file individually? Perhaps the accompanying code will help explain my problem. Any help would be appreciated.
Current matrix's created after analysis: ALL_PPI ALLG_Means_tr DPPI SPSS_PPI_Means SPSS_PPI print('SHK3_ASD_W3_PPI','-dpng','-r300');
Current Code:
cd ('/Users/aamaya/Documents/MATLAB/PPI_All/Data_Analysis');
print('SHK3_ASD_W3_PPI','-dpng','-r300');
csvwrite('SHK3_ASD_W3_PPI.csv',ALL_PPI)
csvwrite('SHK3_ASD_W3_Means.csv',ALLG_Means_tr)
csvwrite('SHK3_ASD_W3_DeltaPPI.csv',DPPI)
csvwrite('SHK3_ASD_W3_MSPSS.csv',SPSS_PPI_Means)
csvwrite('SHK3_ASD_W3_PSPSS.csv',SPSS_PPI)
cd ('/Users/aamaya/Documents/MATLAB');
Desired Code:
Experiment_Name=['SHK3_ASD_W3_PPI']
cd ('/Users/aamaya/Documents/MATLAB/PPI_All/Data_Analysis');
print('Experiment_Name','-dpng','-r300');
csvwrite('Experiment_Name.PPI.csv',ALL_PPI)
csvwrite('Experiment_Name.Means.csv',ALLG_Means_tr)
csvwrite('Experiment_Name.DeltaPPI.csv',DPPI)
csvwrite('Experiment_Name.MSPSS.csv',SPSS_PPI_Means)
csvwrite('Experiment_Name.PSPSS.csv',SPSS_PPI)
cd ('/Users/aamaya/Documents/MATLAB');
0 Kommentare
Akzeptierte Antwort
dpb
am 1 Jul. 2014
This specifically addresses creating input file names, but the idea is the same for output files as well--pick some naming algorithm and go for it...it can be sequential numbers as demonstrated there, but there's nothing that says it must be. Use whatever scheme makes sense for your situation, just as long as you have a rule to create the name.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Structures finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!