How can I declare a string variable which I can call when loading a filename?
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Maria Py
le 25 Juil 2016
Commenté : Azzi Abdelmalek
le 25 Juil 2016
I want to plot files amongst which the only thing that changes is a word. Therefore, I want to declare a variable which I can call in the filename. Model=(CanESM); load('Model.mean.dat'); ...
0 commentaires
Réponse acceptée
Azzi Abdelmalek
le 25 Juil 2016
Modifié(e) : Azzi Abdelmalek
le 25 Juil 2016
model='Model.mean.dat'
load(model);
3 commentaires
Azzi Abdelmalek
le 25 Juil 2016
Model='CanESM';
file=sprintf('%s.mean.dat',Model)
load(file)
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur String Parsing 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!