Kate J.
unread,Jun 13, 2012, 9:39:07 PM6/13/12You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I have a system of files that includes a Simulink model that calls a .mexw32 file and an externally-written .lib file. To run my system, I compile my c-mex s-function code into a .mexw32 file, which is then called by one of my Simulink model blocks when the model runs.
Description of my system usage: after my c-mex s-function is compiled into the mex-file, I click the “play” button on my Simulink model; the model runs, and the system generates a set of output files. The execution of the system is partially determined by parameter values located in text files that are read by the mex-file. Once a particular run finishes, and I remove the generated output files to a separate, permanent location, I adjust the parameters in the text files, and re-click “play” in the Simulink model, to perform another system run, and generate a new set of output files.
The problem: I’ve noticed that the parameters used by my system in the *first* run, appear to determine the behavior of *all* subsequent runs. This shouldn’t be true; ideally, each time I modify the parameters, I should see unique behavior corresponding to that particular set of parameters. Instead, if e.g. the initial set of parameters performs well (i.e. generates a nice-looking set of output data), then it doesn’t matter if I use a set of (known) very poor parameters subsequently – every additional set of data that I generate *still* looks good, even though they *shouldn’t*.
I’ve tried executing “clc” , “clear all” and “clear all; close all; clc;” commands between runs; however, this doesn’t change the fact that every subsequent run still depends entirely on the parameters from the very first run. I’m really not sure which aspect(s) of my system are the culprits causing this problematic carryover behavior. But the only solution I’ve discovered, so far, is to shut down Matlab and restart it, with my new set of parameters specified for the first new run.
Has anyone experienced a similar problem? If all of the “clc” and “clear all” commands haven’t worked to reset the Matlab workspace between system runs, are there other, possibly more powerful alternatives that I could try? Or, am I doomed to having to shut down and then restart Matlab every single time I need to change parameters?
Thanks in advance for your input.