Repmat is not a built-in function in Matlab. It is slow. An alternative is to do “repmat” by matlab indexing, which is faster.

x=[1 2 3 4]' ; x(:, ones(4,1));%repmat(x, [1 4]) ; x=[1 2 3 4]; x(ones(1,4),:);%repmat(x,[4 1]) |

A more detailed tutorial is found here.

Comments (4)