Repeating Matrix Element Until N Times
Mostrar comentarios más antiguos
Excuse me everyone, I want ask that how to repeating the matrix element like this example :
Example: y = [1; 2; 3; 4] and then I want the output like this (for example until N=7) :

Thanks
2 comentarios
Dirga Eka Putra L
el 23 de Sept. de 2018
Editada: Dirga Eka Putra L
el 23 de Sept. de 2018
Respuesta aceptada
Más respuestas (1)
dpb
el 23 de Sept. de 2018
Just one of many possible ways...
L=length(y);
N=7;
x=repmat(y,ceil(N/L),1);
x=x(1:N);
1 comentario
Dirga Eka Putra L
el 23 de Sept. de 2018
Categorías
Más información sobre Elementary Math en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
