view m-toolbox/test/gui/functions/gltpda_plus.m @ 37:a4b7ceae0403 database-connection-manager

Show backtrace on unit test errors
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Mon, 05 Dec 2011 16:20:06 +0100
parents f0afece42f48
children
line wrap: on
line source

function gltpda_plus(handles)

% GLTPDA_PLUS adds together the selected AOs to create a new AO.
% 
% M Hewitson 15-02-07
% 
% $Id: gltpda_plus.m,v 1.1 2007/03/12 13:00:31 hewitson Exp $
% 

%% Get selected AOs
% get AO array
aos = getappdata(handles.main, 'aos');

% Get selected objects
selected = get(handles.aoList, 'Value');
as = aos.objs(selected);

%% Add these together using lincom

if length(as) < 2
  error('### Select at least two analysis objects.');
elseif length(as) == 2
  b = as(1)+as(2);
else
  pl = plist(param('coeffs', ones(1,length(as))));
  b = ltpda_lincom(as, pl);
end

%% Add new ao to list 

% Add to object array
aos.objs  = [aos.objs b];
aos.nobjs = aos.nobjs + length(b);

% Set array
setappdata(handles.main, 'aos', aos);

% Update object list
gltpda_setAOlist(handles);

% END