Borrar filtros
Borrar filtros

Calling coder.ceval with external variable as one of the arguments

2 visualizaciones (últimos 30 días)
I have a model with a MATLAB system block used for generating custom c-code. In my external C-code, I have a global variable called "buffer", which is an array of 8 bytes. In the step function I want to be able to copy a portion of the data from "buffer" to the output of the function (see below). Is there a way to declare the fact that "buffer" is an external variable?
function y = stepImpl(obj)
y = uint32(0)
if( coder.target('Rtw') )
coder.ceval('memcpy', coder.ref(y), coder.ref(buffer(2)), uint8(4))
end
end

Respuestas (0)

Categorías

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

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by