Mercurial > hg > ltpda
comparison m-toolbox/m/gui/ltpdv/callbacks/ltpdv_export_objects.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 ltpdv_export_objects(varargin) | |
2 | |
3 % Handles | |
4 myh = varargin{1}; | |
5 mainfig = varargin{end}; | |
6 | |
7 | |
8 % check current workspace variables | |
9 basename = 'ex_obj'; | |
10 ex = 0; | |
11 n = []; | |
12 vars = evalin('base', 'who'); | |
13 for j=1:length(vars) | |
14 v = char(vars{j}); | |
15 if strncmp(basename, v, length(basename)) == 1 | |
16 % get the number | |
17 n = [n str2num(v(end-1:end))]; | |
18 end | |
19 end | |
20 | |
21 % Get selected objects | |
22 objs = ltpdv_get_selected_objs(mainfig); | |
23 | |
24 % Loop over selected objects | |
25 for j=1:numel(objs) | |
26 obj = objs{j}; | |
27 ex = max([n ex])+1; | |
28 varname = sprintf('%s_%02d', basename, ex); | |
29 assignin('base', varname, obj); | |
30 end | |
31 | |
32 | |
33 % END |