Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Send values from function to Simulink model

$
0
0
Hello everybody,
I am new in this forum and this is my first thread. I hope i place it right. :)

I want a function to run a Simulink-model. Normally i do use 'normal' m-files, but this time it has to be a function. Inside of the function I am declaring many values/parameters, like gravitation, density, area and so forth. I want the model to use them. This is easy using a m-file, which is not a function. I just need to declare all values to the base workspace. This doesn't work using a function.
I found the information about the sim-command on these pages:
http://www.mathworks.de/de/help/simulink/slref/sim.html
http://www.mathworks.de/de/help/simulink/ug/using-the-sim-command.html

They recommend using parameters by inserting in the command or as a struct. But these parameters are limited to special simulation parameters, like "ConcurrencyResolvingToFileSuffix".

Until now I assigned the values in the base workspace, using the command 'assignin', but this seems a little too messy. I would like to send them directly to the model.

So, what to do? I'm looking forward to read from you. :-]
cheers Daniel

Viewing all articles
Browse latest Browse all 19628

Trending Articles