资源简介
自己写的一个寻找割集的matlab小程序,主要用来在生成树的过程中寻找割集
代码片段和文件信息
function [ chord_link ] = find_cutset( netold_treereplacementref_tree )
%UNtitleD5 Summary of this function goes here
% Detailed explanation goes here
%find the cutset of the replacement line in old tree
line_re_indx=ref_tree(replacement);
re_op_node=net(line_re_indx1);
re_ed_node=net(line_re_indx2);
%decode the old tree
m_old_tree=length(old_tree);
node_old_tree=zeros(m_old_tree2);
for i=1:m_old_tree
node_old_tree(i1)=net(old_tree(i)1);
node_old_tree(i2)=net(old_tree(i)2);
end
island_1=zeros(1m_old_tree*2);
island_2=zeros(1m_old_tree*2);
%search the first isolated island
island_indx=2;
search_target=re_op_node;
avoid_target=re_ed_node;
island_1(1)=search_target;
search_index=1;
search_tree=node_old_tree;
while search_target~=0 %this segment can be optimized
for m_node_indx=1:m_old_tree
if search_tree(m_node_indx1)==search_target && search_tree(m_node_indx2)~=avoid_target
island_1(island_indx)=search_tree(m_node_indx2);
island_indx=island_indx+1;
search_tree(m_node_indx:)=0;
elseif search_tree(m_node_indx2)==search_target && search_tree(m_node_indx1)~=avoid_target
island_1(island_indx)=search_tree(m_node_indx1);
island_indx=island_indx+1;
search_tree(m_node_indx:)=0;
end
end
search_index=search_index+1;
search_target=island_1(search_index);
end
%search the second isolated island
%can also be optimized
island_indx=2;
search_index=1;
search_target=re_ed
- 上一篇:计算短时过零率MATLAB
- 下一篇:matlab递归生成树
相关资源
- matlab递归生成树
- 计算短时过零率MATLAB
- 用matlab实现模拟退火kmeans聚类
- 逐步回归MATLAB程序(新)
- [MATLAB+R2017a人工智能算法][张德丰][程
- sgy地震波数据文件及MATLAB处理sgy文件
- 信道编码程序matlab
- 二维粒子群算法的matlab源程序.docx.z
- QPSKMATLAB仿真程序
- Matlab 下限制边界泰森多边形voronoi计算
- Matlab实现读取二进制数据绘制波形,
- matlab2014b
- gabormatlab
- gamma校正matlab
- 回馈整流MATLAB仿真
- matlab提取音频特征
- 数据预处理 剔除奇异点 matlab程序
- MATLAB+遗传算法+多车有容量约束VRP
- MATLAB遗传算法VRP
- 基于Matlab直线检测
- 灰色神经网络Matlab代码
- MATLAB课程设计——数字带通FIR滤波器
- Turbo码的编解码的Matlab及VC 源代码
- 通信原理中16QAM信号 MATLAB程序
- matlab实现JPEG
- 基于MATLAB的机器人避障程序
- 将图像放大或缩小的matlab代码
- 复杂网络中GN,FN网络的matlab实现
- IMM交互多模程序MATLAB
- MATLAB实现图像的Arnold置乱
评论
共有 条评论