Adding a struct as third input parameter in a ode15s event

1 view (last 30 days)
Hi,
I have a problem. I want to use an event in my simulation in order to make a time specific change. In this problem I want to be able to change the specific time in an optimization problem, and then want to add a struct to the event as a third input parameter. Is this possible in some way?
So the description of the event becomes:
function [value,isterminal,direction] = event_1(t,y,d)
when I tried I only get "Not enough input arguments."

Answers (1)

Walter Roberson
Walter Roberson on 17 Mar 2014
d = structure_to_pass_to_ode_event;
event_to_pass_to_ode = @(t,y) event_1(t, y, d);

Community Treasure Hunt

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

Start Hunting!