필터 지우기
필터 지우기

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 CenterFile Exchange에서 Simulink Coder에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by