Store fllepath in variable
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello all! Quick question:
is it possible to store a fullpath: C:\Users\ecorbett\Documents\MATLAB\Labelers\fred into a variable and use that variable in functions like csvwrite?
0 Commenti
Risposta accettata
Nathan Greco
il 2 Ago 2011
Yes. Just store it as a string.
filepath = 'C:\Users\ecorbett\Documents\MATLAB\Labelers\fred';
filename = 'text.csv';
csvwrite(fullfile(filepath,filename),MatrixYouWantToStoreToFile);
Più risposte (1)
Sean de Wolski
il 2 Ago 2011
Sure:
fp = 'C:\Users\ecorbett\Documents\MATLAB\Labelers\fred\' %added extra \
csvwrite([fp 'my_example_csv.csv'], magic(5)) %add file name
Vedere anche
Categorie
Scopri di più su Text Files 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!