par_info.m

来自「matlab源代码」· M 代码 · 共 41 行

M
41
字号
function info=par_info(structure,mnem)
% Get the row of "structure.parameter_info" that pertains to a particular 
% parameter. If global variable S4M.case_sensitive is set to false, the case
% of the parameter mnemonic is disregarded
% Written by: E. R., September 12, 2003
% Last updated:
%
%             info=par_info(structure,mnem);
% INPUT
% structure   structure with field "parameter_info"
% mnem        parameter mnemonic
% OUTPUT
% info        cell array (cell vector with three components) with info about 
%             column with mnemonic "mnem"
%             {mnemonic,units of measurement,description}

global S4M

mnems=structure.parameter_info(:,1);
if S4M.case_sensitive
   idx=find(ismember(mnems,mnem));
else
   idx=find(ismember(lower(mnems),lower(mnem)));
end

if ~isempty(idx) & length(idx) == 1
   info=structure.parameter_info(idx,:);
   return
end

% Handle error condition
if isempty(idx)
   disp([' Parameter "',mnem,'" not found. Available parameters are:'])
   disp(mnems')
else
   disp([' More than one parameter found: ',cell2str(mnems(idx),', ')])
end

error(' Abnormal termination')

⌨️ 快捷键说明

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