MATLAB Answers

0

Reading string within a string

Asked by jinang patel on 12 Nov 2019 at 21:01
Latest activity Answered by David Hill on 12 Nov 2019 at 21:28
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

  0 Comments

Sign in to comment.

1 Answer

Answer by David Hill on 12 Nov 2019 at 21:28
 Accepted Answer

b={sprintf('problem.%s',a),sprintf('problem1.%s',a)};

  0 Comments

Sign in to comment.