pgetdatatypes.m

来自「利用Stateflow 进行嵌入式代码开发很好用」· M 代码 · 共 26 行

M
26
字号
function [slDt, rtwDt] = pGetDataTypes(inDataType)
%PGETDATATYPES Returns the SL (SS_xxxx) and RTW (xxxx_T) DataTypes according 
%   to the input (xxxx).
%

%   Copyright 2005 The MathWorks, Inc.
%   $File: $
%   $Revision: $
%   $Date:  $

rtwDataTypes = pGetRTWDataTypes;
slDataTypes = pGetSLDataTypes;
cDataTypes = pGetCDataTypes;

[s, e, t] = regexp(inDataType, '(const)?\s*(\w+)');
dataType = inDataType(t{1}(2,1):t{1}(2,2));

idx = find(strcmp(dataType, cDataTypes));

if ~isempty(idx)
    slDt = slDataTypes{idx};
    rtwDt = rtwDataTypes{idx};
else
    slDt = 'unknow';
    rtwDt = 'unknow';
end

⌨️ 快捷键说明

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