C-Mex S function - storing values between timesteps?
2 次查看(过去 30 天)
显示 更早的评论
Probably a noobish question...
For example, would it be possible to write a C mex S-function that returned the input value from three timesteps ago?
I ask this because I'd like to write a neural network as a C mex and would like weights etc to be stored between iterations.
Best regards,
Craig
0 个评论
采纳的回答
TAB
2012-12-10
You can create the discrete states in your s-function and save the input values in state variables in mdlupdate() function. You can output the values of these discrete variables (which are nothing but delayed values) in mdlOutput() function.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Prepare Model Inputs and Outputs 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!