shapelike.sci
来自「小波分解源代码」· SCI 代码 · 共 40 行
SCI
40 行
function vec = ShapeLike(sig,proto)
// ShapeLike -- Make 1-d signal with given shape
// Usage
// vec = ShapeLike(sig,proto)
// Inputs
// sig a row or column vector
// proto a prototype shape (row or column vector)
// Outputs
// vec a vector with contents taken from sig
// and same shape as proto
//
// See Also
// ShapeAsRow
//
// Copyright Aldo I Maalouf
sp = size(proto);
ss = size(sig);
if( sp(1)>1 & sp(2)>1 )
disp('Weird proto argument to ShapeLike')
elseif ss(1)>1 & ss(2) > 1,
disp('Weird sig argument to ShapeLike')
else
if(sp(1) > 1),
if ss(1) > 1,
vec = sig;
else
vec = sig(:);
end
else
if ss(2) > 1,
vec = sig;
else
vec = sig(:)';
end
end
end
endfunction
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?