comparison m-toolbox/classes/@LTPDAworkbench/clearBlockVariables.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 clearBlockVariables(rbs)
2
3 Nrbs = numel(rbs);
4 % loop over blocks
5 for jj=1:Nrbs
6 block = rbs(jj);
7 if isa(block, 'mpipeline.canvas.MElementWithPorts')
8 % get the src block for each input
9 inputs = block.getInputs();
10 % Loop over the inputs to get the variable names of the inputs
11 for kk=0:inputs.size()-1
12 ip = inputs.get(kk);
13 srcblock = block.getSourceBlock(ip.getNumber);
14 % check each output port for this src block
15 outputs = srcblock.getOutputs();
16 for ll=0:outputs.size()-1
17 % can we clear the result for this src block?
18 if srcblock.canDeleteResult(ll)
19 outvar = [char(srcblock.getVarName(ll)) ' = [];'];
20 error('please fix the outvar name')
21 evalin('base', outvar)
22 end
23 end
24 end
25 end
26 end
27
28
29 end