MATLAB: Rempet

rempte

I have a matrix and a vector, I want to repmat them the same my mean is that if I change the first row of the matrix I want this also happen the same for the vector,

Best Answer

X=rand(4)
Y=rand(4,1)
Index=[2 3 4 1];
X=X(Index,:)
Y=Y(Index,:)