From: PinkLab on
I have created a block diagram and trying to add a callback function so it load the m-file when the block is simulated. Any help how to invoke the m-file through simulation of a block?
From: checker i on
"PinkLab " <pinklab(a)pinklab.com> wrote in message <hfrggl$65e$1(a)fred.mathworks.com>...
> I have created a block diagram and trying to add a callback function so it load the m-file when the block is simulated. Any help how to invoke the m-file through simulation of a block?

Have you tried Block Properties/call Backs/ StartFcn

(Right click on the block and select the BlockProperties)
From: checker i on
"PinkLab " <pinklab(a)pinklab.com> wrote in message <hfrggl$65e$1(a)fred.mathworks.com>...
> I have created a block diagram and trying to add a callback function so it load the m-file when the block is simulated. Any help how to invoke the m-file through simulation of a block?

If its for total model, you can try the StartFcn under Model Properties
From: PinkLab on
I have seen that but not sure how to write the syntax in that to invoke the m-file, any idea or example please? I am trying to take user input for block gain values...please help
From: checker i on
"PinkLab " <pinklab(a)pinklab.com> wrote in message <hfrksu$ieb$1(a)fred.mathworks.com>...
> I have seen that but not sure how to write the syntax in that to invoke the m-file, any idea or example please? I am trying to take user input for block gain values...please help

Is u r m-file a function or script? If its a function, just call your fcn in the 'StartFcn' similar to how u call it from your command line.

If its a script, I don't think u can call scripts frm 'StartFcn'.( The name itself says its a function. I may be wrong though!)