how to properly use num2str with string input for load or title funtions.
27 次查看(过去 30 天)
显示 更早的评论
Any idea why the numerical value isn't properly converted into a string?
0 个评论
采纳的回答
Yihao Cui
2019-8-14
1 个评论
Neuropragmatist
2019-8-14
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.
更多回答(1 个)
Neuropragmatist
2019-8-14
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Characters and Strings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!