How can I save the output of my program to a uigetdir directory (directory changes based on input)?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
qualiaMachine
il 2 Lug 2015
Risposto: Walter Roberson
il 3 Lug 2015
I am trying to add some code to the end of a small program which can automatically save the output of my program to the same folder that I select to get the program's input (tempDir in the code). The code is short for this program, so perhaps just pasting the program here will be the best way to explain. As you can see, I am trying to save my output (consisting of one variable called 'data' and a structure called 'ans') to the same folder as 'tempDir'. Note: tempDir changes for each file that needs to be run.
tempDir = uigetdir(['/Volumes/WININSTALL/DBS_Patients/3k814/STN Right/Pass 1/C/'],'Select Data Folder');
tempData = uigetfile(['/Volumes/WININSTALL/DBS_Patients/3k814/STN Right/Pass 1/C/*.apm'],'Select Data');
APMReadData([tempDir '/' tempData])
filename = 'continuous.data.mat';
data = ans.channels.continuous(:,1)';
save(filename,'data')
0 Commenti
Risposta accettata
Walter Roberson
il 3 Lug 2015
APMReadData(fullfile(tempDir, tempData))
save(fullfile(tempDir, filename),'data')
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!