matlab中datatype,使用 DataTypeStr 参数指定数据类型

以编程方式查看 DataTypeStr

您可以在 MATLAB® 命令行窗口中使用 Simulink.Mask.get 命令来查看为模块封装指定的数据类型值。MATLAB 使用预定义的命名法在命令行中表示数据类型信息。

此示例说明如何以编程方式查看示例模型封装参数的 DataTypeStr 参数。

maskobj = Simulink.Mask.get(gcb)

maskobj =

Mask with properties:

Type: ''

Description: ''

Help: ''

Initialization: ''

SelfModifiable: 'off'

Display: ''

IconFrame: 'on'

IconOpaque: 'opaque'

RunInitForIconRedraw: 'off'

IconRotate: 'none'

PortRotate: 'default'

IconUnits: 'autoscale'

Parameters: [1×4 Simulink.MaskParameter]

BaseMask: [0×0 Simulink.Mask]

ParameterConstraints: [0×0 Simulink.Mask.Constraints]

BlockConstraintRules: [0×0 Simulink.Mask.BlockConstraints]

ConstraintParamAssociator: [0×0 Simulink.Mask.ConstraintParamAssociator]

maskobj.getParameter('DataTypeStrParameter')

ans =

MaskParameter with properties:

Type: 'unidt({a=4|2|3|1}{i=Inherit: auto|Inherit: Inherit via internal rule}{b=double|single})'

TypeOptions: {0×1 cell}

Name: 'DataTypeStrParameter'

Prompt: 'Output data type'

Value: 'Inherit: auto'

Evaluate: 'on'

Tunable: 'off'

NeverSave: 'off'

Hidden: 'off'

ReadOnly: 'off'

Enabled: 'on'

Visible: 'on'

ShowTooltip: 'on'

Callback: ''

Alias: ''

结果显示为 DataTypeStr 参数定义的属性。此示例定义指定类型选项的命名法:

Type: 'unidt({a=4|2|3|1}{i=Inherit: auto|Inherit: Inherit via internal

rule}{b=double|single})'

此处,Type 显示为 DataTypeStr 参数指定的值,并具有以下定义:

a 定义 Associations,其对应值为 4、2、3、1。这些值是参数的索引编号,依次代表 DataTypeStr、Min、Max 和 Edit 参数。

i 将 Inherit rules 及其对应的值定义为 Inherit: Same as first input。

b 将 Built-in types 及其对应的值定义为 double 和 single。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值