reprow.m

来自「This a collection of MATLAB functions fo」· M 代码 · 共 16 行

M
16
字号
function x = reprow(x, N)
%function xrep = reprow(x, N)
%
% Replicate a row vector x = [x1, x2, ...] so that
% 
%           x1 x2 x3 ...
% xrep =    x1 x2 x3 ...
%           ...
%
% This function is much faster than using the MatLab function REPMAT.
% ie, xr = repmat(x, N, 1);
%
% Tim Bailey 2005.

x = x(ones(1,N), :);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?