필터 지우기
필터 지우기

dec2bin is not working in Embedded Matlab Function Block

조회 수: 1 (최근 30일)
Aniket
Aniket 2013년 6월 19일
Hi,
I have written following code in Embedded Matlab Function Block,
_function output = system(input)
out1 = dec2bin(input); out2 = bin2dec(out1(1:8)); output = typecast(out2,'uint8');
end_
Here 'input' is a 8 byte data and I want to fetch its first byte only.
While compiling this code gives following error:
'The function 'dec2bin' is not supported by Embedded MATLAB for code generation.'
Please suggest me the another way of doing it.
Thanks in advance.
  댓글 수: 2
Jan
Jan 2013년 6월 19일
편집: Jan 2013년 6월 19일
What exactly is "8 byte data" and what type does "input" have?
Aniket
Aniket 2013년 6월 19일
'input' is coming from CAN Input Signal Block. In CAN database that particular signal is 8 byte signal.
I want to analyse every single byte of that 8 byte input data.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kaustubha Govind
Kaustubha Govind 2013년 6월 19일
You may find this previous discussion useful: Binary to Decimal conversion in Simulink and vice versa.

카테고리

Help CenterFile Exchange에서 Code Generation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by