Hello all,
I'm converting some matlab scripts to matlibplot, and I don't know how
to make some "slicing" efficently with matlibplot. What I want to do is
to translate a matlab code like:
x = [[01, 02, 03, 04, 05, 06];
[11, 12, 13, 14, 15, 16];
[21, 22, 23, 24, 25, 26];
[31, 32, 33, 34, 35, 36];
[41, 42, 43, 44, 45, 46];
[51, 52, 53, 54, 55, 56]
];
x(2:4,1:4)
ans =
11 12 13 14
21 22 23 24
31 32 33 34
What I have done now in matplotlib is like:
x = array ([[01, 02, 03, 04, 05, 06],
[11, 12, 13, 14, 15, 16],
[21, 22, 23, 24, 25, 26],
[31, 32, 33, 34, 35, 36],
[41, 42, 43, 44, 45, 46],
[51, 52, 53, 54, 55, 56],
])
for i in range (3):
for j in range (4):
x2 [i][j] = x [i+1][j+0]
so, x2 is now what I want:
[[11,12,13,14,]
[21,22,23,24,]
[31,32,33,34,]]
I will be very happy to make the "slicing" without the loop...
I'm pretty new to matlibplot, so sorry if this is a too simple question.
Thanks in advance for your help.
Olivier
···
--
. __ . ___ __. | Olivier Bornet Olivier.Bornet@...567...
/ / ` / / / / / | IDIAP http://www.idiap.ch/~bornet/
/ / / / /--/ /--' | CP 592 http://www.idiap.ch/~bornet/pgp/
/ /__.' / / / / | CH-1920 Martigny PGP-key: 0xC53D9218