comparison m-toolbox/test/gui/functions/gltpda_minus.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 function gltpda_minus(handles)
2
3 % GLTPDA_MINUS for an array of analysis objects subtract A(2:end) from
4 % A(1).
5 %
6 % M Hewitson 15-02-07
7 %
8 % $Id: gltpda_minus.m,v 1.1 2007/03/12 13:00:31 hewitson Exp $
9 %
10
11 %% Get selected AOs
12 % get AO array
13 aos = getappdata(handles.main, 'aos');
14
15 % Get selected objects
16 selected = get(handles.aoList, 'Value');
17 as = aos.objs(selected);
18
19 %% Add these together using lincom
20
21 if length(as) < 2
22 error('### Select at least two analysis objects.');
23 elseif length(as) == 2
24 b = as(1)-as(2);
25 else
26 pl = plist(param('coeffs', [1 -1*ones(1,length(as)-1)]));
27 b = ltpda_lincom(as, pl);
28 end
29
30 %% Add new ao to list
31
32 % Add to object array
33 aos.objs = [aos.objs b];
34 aos.nobjs = aos.nobjs + length(b);
35
36 % Set array
37 setappdata(handles.main, 'aos', aos);
38
39 % Update object list
40 gltpda_setAOlist(handles);
41
42
43
44
45 % END