I am using C mex S-function to Generate a Simulink Block called sFct_Dyn_Block by the following mex file:
mex -D__SIM_MODE__ src_Dyn_Block\sFct_Dyn_Block.c src_Dyn_Block\Dyn_Block.c src_Dyn_Block\hyd_dyn.c src_Dyn_Block\hst.c
The sequence of my code:
- I run a matlab file called input_users.m to collect some user inputs
- the user inputs are now in matlab workspace
- when I run my mex class I need to pass these variables some how from matlab workspace to my hyd_dyn.c class
- finally when I run my simulink model the output of sFct_Dyn_Block should change every time according to the userinputs
I can't pass the userinput variables from matlab workspace to my hyd_dyn.c class, I tried everything for 4 days but nothing workout.
I appreciate any help !!