I have a matrix W of size ExF, and I have a matrix D of size NxFxNxE where D(n,:,n,:) = W'

Is there a fast way to replicate W to form D without having to loop through N

Thanks!

Skip to content# MATLAB: Fast way to replicate array

matrixrepmat

I have a matrix W of size ExF, and I have a matrix D of size NxFxNxE where D(n,:,n,:) = W'

Is there a fast way to replicate W to form D without having to loop through N

Thanks!

## Best Answer