📄 isequivalent.m
字号:
function status=isequivalent(cell1,cell2)
global CELLS
status_boundary=0;
status_hpflags=0;
status_pthflags=0;
status=0;
if length(CELLS{cell1}.boundary) == length(CELLS{cell2}.boundary)
if all(CELLS{cell1}.boundary ==CELLS{cell2}.boundary)
status_boundary=1;
end
end
if length(CELLS{cell1}.hpflags) == length(CELLS{cell2}.hpflags)
if all(CELLS{cell1}.hpflags ==CELLS{cell2}.hpflags)
status_hpflags=1;
end
end
if length(CELLS{cell1}.pthflags) == length(CELLS{cell2}.pthflags)
if all(CELLS{cell1}.pthflags ==CELLS{cell2}.pthflags)
status_pthflags=1;
end
end
if status_pthflags & status_boundary & status_hpflags
status=1;
end
if ~status;
[C,d] = cell_ineq(CELLS{cell1}.boundary,CELLS{cell1}.hpflags);
region1 = linearcon([],[],C,d);
[C,d] = cell_ineq(CELLS{cell2}.boundary,CELLS{cell2}.hpflags);
region2 = linearcon([],[],C,d);
intersection_region=region1®ion2;
if ~isempty(intersection_region)
if isempty(minus(region1,region2))
if isempty(minus(region2,region1))
status=1;
end
end
end
end
return
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -