remove.m

来自「这是一个很适合研究和学习用的电力系统仿真软件」· M 代码 · 共 25 行

M
25 行
字号
function a = remove(a,idx)

if ~a.n, return, end
if isempty(idx), return, end

for i = 1:length(idx)
  jdx = find(a.ty1 == idx(i));
  if jdx 
    a.ty1(jdx) = [];
    a.tg1(jdx) = [];
    a.tg2(jdx) = [];
    a.tg3(jdx) = [];
  end
  jdx = find(a.ty2 == idx(i));
  if jdx 
    a.ty2(jdx) = [];
    a.tg(jdx) = [];
  end
end

a.con(idx,:) = [];
a.bus(idx) = [];
a.syn(idx) = [];
a.n = a.n - length(idx);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?