Reputation: 1231
I am loading my Simulink Model to a microprocessor
. After that I want to change
a value of a Block parameter
.
In the picture below the data comes to Matlab Function
block is coming from Serial Port
. Now, appearently th incoming data is assigned to input u
of Matlab Function block. In that Matlab Function block I want to write a code that changes , for example, coefficient of s
in the Transfer Fcn block. Or it can change any other parameter you can give in code hypothetically.
If anybody can give me any solution that would be ver much appreaciated!. Thank you in advance.
Upvotes: 0
Views: 1763
Reputation: 857
Substitute a custom-made subsystem for the transfer function whose parameters have to change, and create the subsystem from basic blocks so that coefficients can be read from signal sources. You might be interested in this
Even if you don't want to change parameters at every time step, the restriction
"[...] calls to
set_param
also preclude the model from ever being compiled into a real-time application."
seems relevant to your case.
Anyway, as far as I know the post linked above still applies in 2014.
Hope that helps.
Upvotes: 1