Calling coder.ceval with external variable as one of the arguments
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 External Code Integration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!