subsasgn.m

来自「基于PSAT 软件的多目标最优潮流计算用于中小型电力系统的分析和管理」· M 代码 · 共 38 行

M
38
字号
function a = subsasgn(a,index,val)switch index(1).type case '.'  switch index(1).subs   case 'con'    if length(index) == 2      a.con(index(2).subs{:}) = val;    else      a.con = val;    end   case 'bus'    a.bus = val;   case 'gen'    a.gen = val;   case 'n'    a.n = val;   case 'P0'    if length(index) == 2      a.P0(index(2).subs{:}) = val;    else      a.P0 = val;    end   case 'Q0'    if length(index) == 2      a.Q0(index(2).subs{:}) = val;    else      a.Q0 = val;    end   case 'store'    if length(index) == 2      a.store(index(2).subs{:}) = val;    else      a.store = val;    end  endend

⌨️ 快捷键说明

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