⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 subsref.m

📁 HERE IS A GOOD PSO TOOL BOX
💻 M
字号:
function B = subsref(A,S)% MONOMIAL/SUBSREF method%switch length(S)     % number of subscripting levels  case 1             % one subscript reference    switch S.type      case '.'        switch S.subs        case 'gpvars'          B = A.gpvars;        case 'c'          B = A.c;        case 'a'          B = A.a;        otherwise          error('Monomial indexation error');        end      case '()'        B = A(S.subs{:});      otherwise        error(['Monomial indexation with ' S.type ' not supported']);    end  case 2             % two subscript references    if ( strcmp(S(1).type,'.') & strcmp(S(1).subs,'a') & strcmp(S(2).type,'()') )      B = A.a(S(2).subs{:});    elseif ( strcmp(S(1).type,'.') & strcmp(S(1).subs,'gpvars') & ...              strcmp(S(2).type,'{}') )      B = A.gpvars{S(2).subs{:}};    else      error('Monomial indexation not supported.');    end  otherwise    error(['Unknown monomial subscript index.']);end

⌨️ 快捷键说明

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