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