Reading string within a string

1 visualización (últimos 30 días)
jinang patel
jinang patel el 12 de Nov. de 2019
Respondida: David Hill el 12 de Nov. de 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

Respuesta aceptada

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

Más respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by