How do I create a vector by repeating a vector

2 visualizaciones (últimos 30 días)
Onovo
Onovo el 28 de Jul. de 2021
Comentada: darova el 28 de Jul. de 2021
Given a Vector A=[1; 2], I want to create a vector B, such that B=[1; 2; 1; 2] . Thanks

Respuestas (1)

KSSV
KSSV el 28 de Jul. de 2021
Editada: KSSV el 28 de Jul. de 2021
A = [1; 2] ;
B = repmat(A,2,1)
B = 4×1
1 2 1 2

Categorías

Más información sobre Simulink en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by