|
"Alin " <alin.ionascu@live.com> wrote in message <jt46uj$jor$1@newscl01ah.mathworks.com>...
> Hello everyone,
>
> I'm trying to start a simulation from within an S-Function which is in my initial simulation.
> I'm using mxCallMATLAB and the function sim.
>
> My problem is the following:
> I need to execute the sim function with a couple of parameters. I want to pass them as a string and for that I'm using mxCreateString:
>
> const char *option = "'example.mdl',35:60";
> mxArray *prhs = mxCreateString(option);
> mexCallMATLAB(0,NULL,1,&prhs,"sim");
>
> the error that I get is:
> The file name ''example.mdl',35:60' is invalid because it does not have the extension ".mdl" or ".slx".
>
> The problem is that when I use mxCreateString it appends ' characters at the beginning and at the end of my string.
>
> Any idea on how so solve this?
> Your help is greatly appreciated.
>
> Alin
Hi Phil,
Thanks for your response.
The next question will be: how do I do this ?
How do I call the sim function with 2 arguments of different types.
In the command window the call would look like this:
sim('example.mdl',40:90); //the second argument is the time simulation interval
Could you please tell me how to call this function with mexCallMATLAB (the code) ?
Thank you.
Best Regards,
Alin
|