Variable as placeholder in an "fopen" statement
9 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Reuben Addison
le 8 Fév 2023
Modifié(e) : Stephen23
le 9 Fév 2023
Still on the issue of a place holder , I am trying to write a code to name the output folder by subject name, I know typically it goes into the braces but this time arround it is not working
''
subject = "PO1"
fid = fopen(['/Users/addison/Documents/Data/"Results2"+{subject}.xls'],'w');
''
1 commentaire
Réponse acceptée
Les Beckham
le 8 Fév 2023
The way I would do this is this
subject = "PO1";
folder = "/Users/addison/Documents/Data/";
filename = "Results2" + subject + ".xls"
fid = fopen(fullfile(folder, filename));
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Large Files and Big Data dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!