sz - Show sizes for any number of variables. USAGE sz(x,y,...) x,y,... variables
0001 %sz - Show sizes for any number of variables. 0002 % 0003 % USAGE 0004 % 0005 % sz(x,y,...) 0006 % 0007 % x,y,... variables 0008 % 0009 0010 % Copyright (C) 2011-2012 by Michaƫl Zugaro 0011 % 0012 % This program is free software; you can redistribute it and/or modify 0013 % it under the terms of the GNU General Public License as published by 0014 % the Free Software Foundation; either version 3 of the License, or 0015 % (at your option) any later version. 0016 0017 function sz(varargin) 0018 0019 if nargin < 1, 0020 error('Incorrect number of parameters (type ''help <a href="matlab:help sz">sz</a>'' for details).'); 0021 end 0022 0023 for i = 1:length(varargin), 0024 str = ''; 0025 s = size(varargin{i}); 0026 % Variable index 0027 str = [str ' [' int2str(i) '] ']; 0028 % Variable size 0029 for j = 1:length(s), 0030 str = [str int2str(s(j)) 'x']; 0031 end 0032 str(end) = []; 0033 disp(str); 0034 end