?? maxsize.m
字號:
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 + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -