|
Hi.
Wasn't quite sure what to put as subject title to explain this.....
I have two matrices, z and x, and I want to produce a cell (t) without using a loop.
>> z
z =
10
20
30
>> x
x =
9 11
19 21
29 31
>> t={'10 (9,11)';'20 (19,21)';'30 (29,31)'}
t =
'10 (9,11)'
'20 (19,21)'
'30 (29,31)'
I've done this for 1 row as follows:
>> p=sprintf(' (%d,%d)', x(1,1),x(1,2))
p =
(9,11)
>> pp={strcat(num2str( z(1)), p)}
pp =
'10 (9,11)'
but I can't figure out how to do it for multiple rows of z and x without using a loop. In reality my z and x will have lots more than 3 rows.
Any suggestions?
|