Reading string within a string

조회 수: 2 (최근 30일)
jinang patel
jinang patel 2019년 11월 12일
답변: David Hill 2019년 11월 12일
Hello,
Is it possible to do the following:
a='userinput' % string
b={'problem.a', 'problem1.a'.....'problemn.a'}
% fuction/conversion? convertStringsToChars doesnt recognize .a as string!!
I want it to be read as b={'problem.userinput'.....'problemn.userinput'}
Thanks,
Jinang

채택된 답변

David Hill
David Hill 2019년 11월 12일
b={sprintf('problem.%s',a),sprintf('problem1.%s',a)};

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by