rmNode

PURPOSE ^

RMNODE remove node with index rmIx of network

SYNOPSIS ^

function [ rmNetwork ] = rmNode( network, rmIx )

DESCRIPTION ^

 RMNODE remove node with index rmIx of network

   [ rmNetwork ] = rmNode( network, rmIx )
   This function remove specific node by index rmIx in network

   Input:
       network: network structure
       rmIx: index of removing node

   Output:
       rmNetwork: network after removing node

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function [ rmNetwork ] = rmNode( network, rmIx )
0002 % RMNODE remove node with index rmIx of network
0003 %
0004 %   [ rmNetwork ] = rmNode( network, rmIx )
0005 %   This function remove specific node by index rmIx in network
0006 %
0007 %   Input:
0008 %       network: network structure
0009 %       rmIx: index of removing node
0010 %
0011 %   Output:
0012 %       rmNetwork: network after removing node
0013 
0014 %   ---------
0015 %   Yen-Nan Lin, NTHU, 2010-2014, Matlab 2012a
0016 
0017 network.matrix(rmIx, :) = [];
0018 network.matrix(:, rmIx) = [];
0019 network.size = network.size - numel(rmIx);
0020 rmLabel = network.label(rmIx);
0021 network.label(rmIx) = [];
0022 network.moduleId(rmIx) = [];
0023 for iLabel = rmLabel
0024     if ~isempty(find(network.inputList == iLabel, 1))
0025         tmpIx = find(network.inputList == iLabel, 1);
0026         network.inputList(tmpIx) = [];
0027         network.inputNumber = network.inputNumber - 1;
0028     elseif ~isempty(find(network.outputList == iLabel, 1))
0029         tmpIx = find(network.outputList == iLabel, 1);
0030         network.outputList(tmpIx) = [];
0031         network.outputNumber = network.outputNumber - 1;
0032     end
0033 end
0034 rmNetwork = network;
0035 end

Generated on Thu 30-Jan-2014 00:00:07 by m2html © 2005