フィルターのクリア

C-Mex S function - storing values between timesteps?

1 回表示 (過去 30 日間)
Craig
Craig 2012 年 12 月 9 日
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

採用された回答

TAB
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.
See this example for discrete state s-function.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by