How can I declare a string variable which I can call when loading a filename?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Maria Py
el 25 de Jul. de 2016
Comentada: Azzi Abdelmalek
el 25 de Jul. de 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 comentarios
Respuesta aceptada
Azzi Abdelmalek
el 25 de Jul. de 2016
Editada: Azzi Abdelmalek
el 25 de Jul. de 2016
model='Model.mean.dat'
load(model);
3 comentarios
Azzi Abdelmalek
el 25 de Jul. de 2016
Model='CanESM';
file=sprintf('%s.mean.dat',Model)
load(file)
Más respuestas (0)
Ver también
Categorías
Más información sobre String Parsing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!