how to properly use num2str with string input for load or title funtions.
7 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Yihao Cui
el 14 de Ag. de 2019
Comentada: Neuropragmatist
el 14 de Ag. de 2019

Any idea why the numerical value isn't properly converted into a string?
0 comentarios
Respuesta aceptada
Yihao Cui
el 14 de Ag. de 2019
1 comentario
Neuropragmatist
el 14 de Ag. de 2019
In future you might want to spend a little time trying to solve the problem yourself, then I wouldn't waste time answering a question you solved before I could even post the answer.
Más respuestas (1)
Neuropragmatist
el 14 de Ag. de 2019
I'm guessing the files you want to load are named something like: 'GST_amorph_P900_Reflection'?
If that's the case you need to make the filename a single string using square brackets:
load(['GST_amorph',num2str(P_names(i)),'_Reflection'])
You will have to do something similar with the line after this one too.
Hope this helps,
M.
0 comentarios
Ver también
Categorías
Más información sobre String 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!