create a function that takes a vector as an input parameter and returns another vector where each component is the initial vector repeated n times.
I have thought about doing the following:
function B = cyclic_shift_recursion(A,n) %n is the number of times the vector is repeated and A is the vector that I want to repeat
if n<=0 returnelse B=[A cyclic_shift_recursion(A,n-1)];endend
I get an error and I do not understand why, how can I correct this? Is there another easy way to do this? Thank you.
Best Answer