Home > FMAToolbox > Helpers > mM.m

mM

PURPOSE ^

mM - Show min and max values for any number of variables.

SYNOPSIS ^

function mM(varargin)

DESCRIPTION ^

mM - Show min and max values for any number of variables.

  USAGE

    mM(x,y,...)

    x,y,...        variables

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 %mM - Show min and max values for any number of variables.
0002 %
0003 %  USAGE
0004 %
0005 %    mM(x,y,...)
0006 %
0007 %    x,y,...        variables
0008 %
0009 
0010 % Copyright (C) 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 mM(varargin)
0018 
0019 if nargin < 1,
0020   error('Incorrect number of parameters (type ''help <a href="matlab:help mM">mM</a>'' for details).');
0021 end
0022 
0023 for i = 1:length(varargin),
0024     str = '';
0025     % Variable index (min)
0026     str = [str '   [' int2str(i) '-] '];
0027     % Variable values (min)
0028     s = min(varargin{i});
0029     for j = 1:length(s),
0030         str = [str num2str(s(j)) ' '];
0031     end
0032     str(end) = [];
0033     disp(str);
0034     str = '';
0035     % Variable index (max)
0036     str = [str '   [' int2str(i) '+] '];
0037     % Variable values (max)
0038     s = max(varargin{i});
0039     for j = 1:length(s),
0040         str = [str num2str(s(j)) ' '];
0041     end
0042     str(end) = [];
0043     disp(str);
0044 end

Generated on Fri 16-Mar-2018 13:00:20 by m2html © 2005