Hi everyone,
I have this code (the following is a simplified version to give the idea):
Rnum = 12;Nnum = 34;First={1};Second={1};for i=15:Nnum iS=mat2str(i); for n=1:Rnum nS=mat2str(n); First{end+1,1}=char({['mytext1 ', iS, 'mypath', nS, 'mytext2 ']}); Second{end+1,1}=char({['mytext1 ', iS, 'mypath', nS, 'mytext2 ',]}); endend
The output is a 241×1 cell array in which the first cell is always 1 and the other cells are containing characters (like: mytext1 15mypath1mytext2 ). What I would like to do is to add, for each iteration of the loops, the symbol ">" in a recursive way in order to obtain:
- mytext1 15mypath1mytext2 > (for the second cell of the "First" cell array);
- mytext1 15mypath2mytext2 >> (for the third cell of the "First" cell array);
- mytext1 15mypath3mytext2 >>> (for the fourth cell of the "First" cell array);
And, of course, exactly the same for the "Second" cell array (starting with >, then >>, then >>>, etc.). This, for all the 241 lines, not only for the inner loop. Any ideas on how to reach this goal?
Thanks a lot,
Gabriele
Best Answer