フィルターのクリア

Is it possible to create and use buses whose elements are single bits in Matlab 8.6 ( 2015b)?

1 回表示 (過去 30 日間)
Chiara Valzecchi
Chiara Valzecchi 2017 年 5 月 9 日
回答済み: Ji Huang 2018 年 3 月 2 日
Hi everyone, I am inheriting a .h where I find data to use as inputs to my stateflow chart. As I am reading Bus, I am representing them by the Bus Editor, but one element is a bit of a uint8 variable.
typedef struct {
uint8 Level_Index:5;
} SF_DATA_TYPE;
How can I define this field so that I can read only that bit?
I have read a similar question done in the past for older versions. I would like to know if something new has been added to do this.
Thank you for your help!

回答 (1 件)

Ji Huang
Ji Huang 2018 年 3 月 2 日
Create a mask with only that is True. Then do a Bit-wise AND. It "filters" out the other bits.

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by