add array to end of itself n times

95 vues (au cours des 30 derniers jours)
darksideofthemoon101
darksideofthemoon101 le 5 Avr 2011
Hi,
I have an array x=(y1,y2) and I want to add copy the values in the array and add them to the end of the array, such as
x=[x,x];
Is there a way to do this for n times, where n would be the number of sets of the original x in the new value of x?
Thanks,
Richard

Réponse acceptée

Paulo Silva
Paulo Silva le 5 Avr 2011
doc repmat
example
n=2;
repmat([1 2],1,n)

Plus de réponses (0)

Catégories

En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by