Reading string within a string

3 Ansichten (letzte 30 Tage)
jinang patel
jinang patel am 12 Nov. 2019
Beantwortet: David Hill am 12 Nov. 2019
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

Akzeptierte Antwort

David Hill
David Hill am 12 Nov. 2019
b={sprintf('problem.%s',a),sprintf('problem1.%s',a)};

Weitere Antworten (0)

Kategorien

Mehr zu Characters and Strings finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by