How can I generate a uint8 type output from the Pulse Generator block in Simulink?

6 ビュー (過去 30 日間)
Piyush Kadkol
Piyush Kadkol 2018 年 9 月 25 日
コメント済み: Piyush Kadkol 2018 年 10 月 1 日
I am using the Pulse Generator to produce a required sawtooth wave which is then used as the control input for a multiport switch. For the model, it's necessary I use uint8 data type but at the moment, am getting a double type output from the pulse generator, and the Embedded Coder won't allow the usage of a data type conversion. Pls advise.. thanks.

回答 (1 件)

Christopher Wallace
Christopher Wallace 2018 年 9 月 28 日
Can you use a gain block with the output data type specified as 'uint8' or does that produce the same results as the convert block?
  1 件のコメント
Piyush Kadkol
Piyush Kadkol 2018 年 10 月 1 日
Hi Christopher, thanks for taking time out and replying to the query. I figured out the way to get the desired data type of the Amplitude, where I just entered datatype(value) in the Amplitude option.. for eg. uint8(5) for an amplitude of 5. I’ll try out the method that you’ve suggested too, as an alternative. Thanks again!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDeployment, Integration, and Supported Hardware についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by