Home > classes > @ao > ctranspose.m

ctranspose

PURPOSE ^

CTRANSPOSE overloads the ' operator for Analysis Objects.

SYNOPSIS ^

function varargout = ctranspose(varargin)

DESCRIPTION ^

 CTRANSPOSE overloads the ' operator for Analysis Objects.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 DESCRIPTION: CTRANSPOSE overloads the ' operator for Analysis Objects.

 CALL:        a = a1'    % only with data = cdata

 VERSION:     $Id: ctranspose.m,v 1.25 2008/09/05 11:15:19 ingo Exp $

 PARAMETERS:  see help for data2D/applymethod for additional parameters

 M-FILE INFO: Get information about this methods by calling
              >> ao.getInfo('ctranspose')

              Get information about a specified set-plist by calling:
              >> ao.getInfo('ctranspose', 'None')

 HISTORY: 08-05-07 A Monsky
             Creation

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 % CTRANSPOSE overloads the ' operator for Analysis Objects.
0002 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0003 %
0004 % DESCRIPTION: CTRANSPOSE overloads the ' operator for Analysis Objects.
0005 %
0006 % CALL:        a = a1'    % only with data = cdata
0007 %
0008 % VERSION:     $Id: ctranspose.m,v 1.25 2008/09/05 11:15:19 ingo Exp $
0009 %
0010 % PARAMETERS:  see help for data2D/applymethod for additional parameters
0011 %
0012 % M-FILE INFO: Get information about this methods by calling
0013 %              >> ao.getInfo('ctranspose')
0014 %
0015 %              Get information about a specified set-plist by calling:
0016 %              >> ao.getInfo('ctranspose', 'None')
0017 %
0018 % HISTORY: 08-05-07 A Monsky
0019 %             Creation
0020 %
0021 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0022 
0023 function varargout = ctranspose(varargin)
0024 
0025   % Check if this is a call for parameters
0026   if utils.helper.isinfocall(varargin{:})
0027     varargout{1} = getInfo(varargin{3});
0028     return
0029   end
0030 
0031   import utils.const.*
0032   utils.helper.msg(msg.MNAME, 'running %s/%s', mfilename('class'), mfilename);
0033   
0034   % Collect input variable names
0035   in_names = cell(size(varargin));
0036   for ii = 1:nargin,in_names{ii} = inputname(ii);end
0037 
0038   % Collect all AOs
0039   [as, ao_invars] = utils.helper.collect_objects(varargin(:), 'ao', in_names);
0040   pl              = utils.helper.collect_objects(varargin(:), 'plist', in_names);
0041 
0042   % Decide on a deep copy or a modify
0043   bs = copy(as, nargout);
0044 
0045   % Combine plists
0046   pl = combine(pl, getDefaultPlist);
0047 
0048   axis = find(pl, 'axis');
0049 
0050   for kk = 1:numel(bs)
0051 
0052     % Special case for cdata-objects because this objects doesn't have x values
0053     if isa(bs(kk).data, 'data2D')
0054 
0055       x = bs(kk).data.x;
0056       y = bs(kk).data.y;
0057 
0058       % Set the y-value to an empty array because the y-data keeps always the same
0059       % shape
0060       bs(kk).data.setY([]);
0061       bs(kk).data.setX([]);
0062 
0063       switch upper(axis)
0064         case 'X'
0065           bs(kk).data.setX(x');
0066           bs(kk).data.setY(y');
0067         case 'Y'
0068           bs(kk).data.setX(x');
0069           bs(kk).data.setY(y');
0070         case 'XY'
0071           bs(kk).data.setX(x');
0072           bs(kk).data.setY(y');
0073         otherwise
0074           error('### Unknown axis to operate on.');
0075       end
0076 
0077     elseif isa(bs(kk).data, 'cdata')
0078       bs(kk).data.setY(bs(kk).data.getY');
0079     else
0080       error('### Unknown data class [%s]', class(bs(kk).data))
0081     end
0082 
0083     % Add history
0084     bs(kk).addHistory(getInfo, pl, ao_invars(kk), bs(kk).hist);
0085     % Set new AO name
0086     bs(kk).setName(['ctranspose(' ao_invars{kk} ')'], 'internal');
0087   end
0088 
0089   % Set output
0090   if nargout > 0
0091     varargout{1} = bs;
0092   end
0093 end
0094 
0095 %--------------------------------------------------------------------------
0096 % Get Info Object
0097 %--------------------------------------------------------------------------
0098 function ii = getInfo(varargin)
0099 
0100   if nargin == 1 && strcmpi(varargin{1}, 'None')
0101     sets = {};
0102     pl   = [];
0103   else
0104     sets = {'Default'};
0105     pl   = getDefaultPlist;
0106   end
0107   % Build info object
0108   ii = minfo(mfilename, 'ao', '', utils.const.categories.op, '$Id: ctranspose.m,v 1.25 2008/09/05 11:15:19 ingo Exp $', sets, pl);
0109 end
0110 
0111 %--------------------------------------------------------------------------
0112 % Get Default Plist
0113 %--------------------------------------------------------------------------
0114 function pl_default = getDefaultPlist()
0115   pl_default = plist('axis', 'xy');
0116 end
0117

Generated on Mon 08-Sep-2008 13:18:47 by m2html © 2003