Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/@LTPDAworkbench/clearBlockVariables.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,29 @@ +function clearBlockVariables(rbs) + + Nrbs = numel(rbs); + % loop over blocks + for jj=1:Nrbs + block = rbs(jj); + if isa(block, 'mpipeline.canvas.MElementWithPorts') + % get the src block for each input + inputs = block.getInputs(); + % Loop over the inputs to get the variable names of the inputs + for kk=0:inputs.size()-1 + ip = inputs.get(kk); + srcblock = block.getSourceBlock(ip.getNumber); + % check each output port for this src block + outputs = srcblock.getOutputs(); + for ll=0:outputs.size()-1 + % can we clear the result for this src block? + if srcblock.canDeleteResult(ll) + outvar = [char(srcblock.getVarName(ll)) ' = [];']; + error('please fix the outvar name') + evalin('base', outvar) + end + end + end + end + end + + +end