Can one define a "directory" as a "variable"?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
alpedhuez
il 23 Nov 2020
Commentato: alpedhuez
il 23 Nov 2020
Suppose I want to use readtable to read a file. I understand the format
readtable('C:\myFolder\myFile.xlsx')
readtable('C:\myFolder\myFile2.xlsx')
But in my case such directory name is very long and it is cumbersome that I need to specify that long directory name each time. Is it possible to define a directory name as a variable and simplify the process?
0 Commenti
Risposta accettata
Fangjun Jiang
il 23 Nov 2020
directory='c:\myfolder';
filename='myfile.xlsx';
readtable(fullfile(directory,filename));
Più risposte (0)
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!