Print word with different name depending on the step of the cycle?
1 view (last 30 days)
I am trying to print a sentence that changes depending on the step in which the cycle is in, something like this:
print '/SampleT',num2str(i),'/SampleT', num2str(i), '_530.00';
This is not working, I would like to have in the end up with something like this:
Max Heiken on 10 Jun 2021
It seems you are coming from Python or similar.
The print function is not used to output text, instead use disp, fprintf, or sprintf. Also, concatenating char arrays requires rectangular brackets.
disp(['/SampleT',num2str(i),'/SampleT', num2str(i), '_530.00']);
fprintf(1, "/SampleT%d/SampleT%d_530.00\n", i, i);