vsize.m

来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 36 行

M
36
字号
function[n]=vsize(varargin)%VSIZE Returns the sizes of multiple arguments%%   VSIZE(X1,X2,... XN) returns the sizes of the input variables.%   These are organized in a matrix of size M x N where M is the number%   of input variables and M is the maximum number of dimensions.%   __________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information%   (C) 2001, 2004 J.M. Lilly --- type 'help jlab_license' for details      if strcmp(varargin,'--t')   vsize_test,returnend   for i=1:length(varargin)  x=size(varargin{i});  xall{i}=x(:)';  L(i)=length(x);endn=0*ones(length(varargin),max(L));for i=1:length(varargin)   index=1:length(xall{i});   n(i,index)=xall{i};endfunction[]=vsize_testx=ones(1,1);y=ones(2,2);z=ones(2,2,3);x=vsize(x,y,z);bool=allall(x==[1 1 0 ; 2 2 0 ;2 2 3]);reporttest('VSIZE', bool)

⌨️ 快捷键说明

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