wrapind.m

来自「fading 在无线中的应用」· M 代码 · 共 20 行

M
20
字号
function indo = wrapind(indi, siz)% DESCRIPTION indo = wrapind(indi, siz)%  Wraps or folds indo back to the range%  1:size in a cyclic fashion.%  wrapind([-1 0 1 2 3 4], 3) => [2 3 1 2 3 1]%  Both input arguments are rounded before usage.% INPUT %  indi -- Any real matrix of any size.%  siz --  A scalar value not exceeded of the output. It must be >=0.5.% OUTPUT%  indo -- the folded version of indo. Has the same size as indi% TRY%  wrapind([-1 0 1 2 3 4], 3)% SEE ALSO%  mod, floor, round, ceil% by Magnus Almgren 951104indo = round(indi) - floor(round(indi-1) ./ round(siz)) .* round(siz);

⌨️ 快捷键说明

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