Borrar filtros
Borrar filtros

dec2bin is not working in Embedded Matlab Function Block

1 visualización (últimos 30 días)
Aniket
Aniket el 19 de Jun. de 2013
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 comentarios
Jan
Jan el 19 de Jun. de 2013
Editada: Jan el 19 de Jun. de 2013
What exactly is "8 byte data" and what type does "input" have?
Aniket
Aniket el 19 de Jun. de 2013
'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.

Iniciar sesión para comentar.

Respuestas (1)

Kaustubha Govind
Kaustubha Govind el 19 de Jun. de 2013
You may find this previous discussion useful: Binary to Decimal conversion in Simulink and vice versa.

Categorías

Más información sobre Code Generation en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by