how to properly use num2str with string input for load or title funtions.
조회 수: 6 (최근 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에서 String에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!