DISPLAY overloads display functionality for xydata objects. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% DESCRIPTION: DISPLAY overloads display functionality for xydata objects. CALL: txt = display(xy) INPUT: xy - xydata object OUTPUT: txt - cell array with strings to display the xydata object M-FILE INFO: Get information about this methods by calling >> xydata.getInfo('display') Get information about a specified set-plist by calling: >> xydata.getInfo('display', 'None') VERSION: $Id: display.m,v 1.12 2008/09/04 15:29:32 ingo Exp $ HISTORY: 31-01-2007 M Hewitson Creation %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001 % DISPLAY overloads display functionality for xydata objects. 0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0003 % 0004 % DESCRIPTION: DISPLAY overloads display functionality for xydata objects. 0005 % 0006 % CALL: txt = display(xy) 0007 % 0008 % INPUT: xy - xydata object 0009 % 0010 % OUTPUT: txt - cell array with strings to display the xydata object 0011 % 0012 % M-FILE INFO: Get information about this methods by calling 0013 % >> xydata.getInfo('display') 0014 % 0015 % Get information about a specified set-plist by calling: 0016 % >> xydata.getInfo('display', 'None') 0017 % 0018 % VERSION: $Id: display.m,v 1.12 2008/09/04 15:29:32 ingo Exp $ 0019 % 0020 % HISTORY: 31-01-2007 M Hewitson 0021 % Creation 0022 % 0023 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0024 0025 function varargout = display(varargin) 0026 0027 %%% Check if this is a call for parameters 0028 if utils.helper.isinfocall(varargin{:}) 0029 varargout{1} = getInfo(varargin{3}); 0030 return 0031 end 0032 0033 xydatas = utils.helper.collect_objects(varargin(:), 'xydata'); 0034 0035 txt = {}; 0036 0037 for i=1:numel(xydatas) 0038 xy = xydatas(i); 0039 banner = sprintf('-------- xydata %02d ------------', i); 0040 txt{end+1} = banner; 0041 0042 txt{end+1} = ' '; 0043 0044 xdata = xy.x; 0045 ydata = xy.y; 0046 xinfo = size(xdata); 0047 yinfo = size(ydata); 0048 0049 txt{end+1} = sprintf(' x: [%d %d], %s', xinfo(1), xinfo(2), class(xdata)); 0050 txt{end+1} = sprintf(' y: [%d %d], %s', yinfo(1), yinfo(2), class(ydata)); 0051 txt{end+1} = sprintf('xunits: %s', char(xy.xunits)); 0052 txt{end+1} = sprintf('yunits: %s', char(xy.yunits)); 0053 0054 banner_end(1:length(banner)) = '-'; 0055 txt{end+1} = banner_end; 0056 0057 txt{end+1} = ' '; 0058 end 0059 0060 if nargout == 0 0061 for ii=1:length(txt) 0062 disp(txt{ii}); 0063 end 0064 elseif nargout == 1 0065 varargout{1} = txt; 0066 end 0067 end 0068 0069 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0070 % Local Functions % 0071 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0072 0073 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0074 % 0075 % FUNCTION: getInfo 0076 % 0077 % DESCRIPTION: Get Info Object 0078 % 0079 % HISTORY: 11-07-07 M Hewitson 0080 % Creation. 0081 % 0082 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0083 0084 function ii = getInfo(varargin) 0085 if nargin == 1 && strcmpi(varargin{1}, 'None') 0086 sets = {}; 0087 pl = []; 0088 else 0089 sets = {'Default'}; 0090 pl = getDefaultPlist; 0091 end 0092 % Build info object 0093 ii = minfo(mfilename, 'xydata', '', utils.const.categories.output, '$Id: display.m,v 1.12 2008/09/04 15:29:32 ingo Exp $', sets, pl); 0094 end 0095 0096 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0097 % 0098 % FUNCTION: getDefaultPlist 0099 % 0100 % DESCRIPTION: Get Default Plist 0101 % 0102 % HISTORY: 11-07-07 M Hewitson 0103 % Creation. 0104 % 0105 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0106 0107 function plo = getDefaultPlist() 0108 plo = plist(); 0109 end 0110