matlab convert模块,Convert Data Types in Simulink Models

This example shows three different methods of converting data types in your model using the Data Type Conversion and Data Type Conversion Inherited blocks. In this model, a Sine Wave block generates the input signal. The Sine Wave block only outputs double-precision data types, so to generate a sine wave with a data type of single, you must perform a data type conversion.

4e67518eeea3420e5b93369d8b46cfbd.png

962cfeb515cbbdf70b463b977dd8ad70.png

In the first row, the Data Type Conversion Inherited block uses the data type coming from the Constant block (single) as the reference data type, and converts the sine wave to single.

In the second row, the Data Type Conversion block has the Output data type set to single, and the sine wave is converted accordingly.

In the third row, the Data Type Conversion1 block has the Output data type set to Inherit: Inherit via back propagation. Because the downstream Gain2 block has a data type of single, the Data Type Conversion1 block converts the sine wave to a data type of single.

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值