comparison m-toolbox/classes/@ao/checkDataType.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 % CHECKDATATYPE Throws an error for AOs with a specified data-type.
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 %
4 % DESCRIPTION: CHECKDATATYPE Throws an error for AOs with a specified data-type.
5 %
6 % CALL: aos.checkDataType('tsdata', 'cdata');
7 %
8 % VERSION: $Id: checkDataType.m,v 1.1 2011/04/15 15:02:18 ingo Exp $
9 %
10 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 function checkDataType(aos, varargin)
13
14 % Loop over the data-types
15 for tt=1:nargin-1
16 dType = varargin{tt};
17
18 for aa = 1:numel(aos)
19 if isa(aos(aa).data, dType)
20 stack = dbstack();
21 error('### The method %s/%s doesn''t work for %s type AO.', class(aos), stack(2).name, dType);
22 end
23 end
24 end
25
26 end