maxsize.m

来自「Link & System-Level Wireless OFDM System」· M 代码 · 共 25 行

M
25
字号
function res = maxsize(varargin)% DESCRIPTION res = maxsize(a,b,c,...)%  Takes any number of inputs and %  leaves the maximum size for all of them.% INPUT%  an argument list with variables of different sizes% OUTPUT%  res --  A vector indicating the maximum size needed%          in order to contain any of the inputs.% TRY%  maxsize(ones(1,2,3), ones(2,1,3,4))% by Magnus Almgren 970527% create a vector with the right length to keep the resultres = zeros(1, max(max(ndimsm(varargin{:})),1)); % go through all argumentsfor i = 1:nargin  siz = sizem_(varargin{i}); % the size of argument i  % keep the max size sofar  res(1:length(siz)) = max(res(1:length(siz)),siz);end  

⌨️ 快捷键说明

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