|
From: | Oscar Bayona Candel |
Subject: | Matrix replication column |
Date: | Fri, 4 Apr 2008 20:44:28 +0200 |
Hi all, I´m using Z=repmat(1:B,M,1) so it brings me a matrix whose size is (M,B) incrising each row in one unit I want to create a new matrix GG whose size will be (M,H*B) The first H colums of GG will be the first column of Z, repeated H times. The second H columns of GG will be the sencond columns of Z repeated. An example: B=3 M=2 H=3 so Z=[1 2 3 1 2 3]; The code I want to construct will have a result like this.... GG=[1 1 1 2 2 2 3 3 3 1 1 1 2 2 2 3 3 3]; I have been trying with kronecker function but I am not able...do you know some function similar. In other context I´ve been able to apply kronecker....its wonderfull¡¡¡ But in this context I am not able to advanced at the moment. If some of you can help me it will be great. Thanks in advance. Tecnología, moda, motor, viajes,.suscríbete a nuestros boletines para estar siempre a la última MSN Newsletters |
[Prev in Thread] | Current Thread | [Next in Thread] |