view m-toolbox/classes/@LTPDAworkbench/clearBlockVariables.m @ 6:2b57573b11c7
database-connection-manager
Add utils.mysql.execute
author
Daniele Nicolodi <nicolodi@science.unitn.it>
date
Mon, 05 Dec 2011 16:20:06 +0100 (2011-12-05)
parents
f0afece42f48
children
line source
+ − 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