From: Reuve Gallant on
Despite the large amount of tutorial material, I have been unsuccessful in doing something very simple. I have a simulink model with a single stateflow chart with an event , triggered by either, input from simulink on port 1 and a constant block called 'On'with value 1 connected to that port.

I built a GUI with a single press button with the following callback:
function onButton_Callback(hObject, eventdata, handles)
nm='twoState/On';
triggerMode=get_param(nm,'value');
if strcmp(triggerMode,'1')
triggerMode='0';
else
triggerMode='1';
end
I can't seem to get the M-FILE invoked when I run simulation.
How do i make sure the model knows about the file or vice versa, and should the above callback work?