Iterate script many times for different database and compare results
Info
This question is closed. Reopen it to edit or answer.
Show older comments

Hi,
Excuse me for my English, I don’t speak English very well so probably I don’t explain well my problem. I add an image to simplify my problem explanation.
I have to run a script many times (for each iteration the dimensions of my interest variables change). This script is the same but the data’s dimensions on which it’s based change. The different data correspond to two scenarios and I need to replace each scenario for two constant values and I need to compare them.
So finally I need to compare the different scenarios for different iterations.
To compare my interest variables I need to display plot and tables.
Then I think to save the result for next elaborations.
Could someone help me?
Thank you
9 Comments
dpb
on 29 May 2014
Essentially, start at the case of one scenario for one iteration and code it. Just be sure to use generalized variable names and functions that can be called for the various scenarios to come.
Then, wrap that in a loop based on the number of cases within a scenario, saving the results in either structures or cell arrays to account for the size differences. You'll have to decide what it is that a "comparison" really means for such cases -- plots are easy; numeric tests may be more of an issue depending on what you're looking at for results.
Once you've got that down, then you can simply add another looping construct over the scenarios. It all sounds more complicated than it likely is given the ease with which Matlab handles reallocation of memory and the difference in types that can be held in cell arrays almost transparently.
dpb
on 1 Jun 2014
first_script
second_script
for i=1:N
third_script
...number_of_cars could be vector or matrix with dimensions depending by number of iterations and subscripts 1 and 2...
Use a cell array would seem to be a reasonable solution altho you could also look at a dynamically-named structure.
See the following link on how to avoid creating variable names of the type you're using above--
dpb
on 2 Jun 2014
Don't call legend each time in the loop, instead wait until after the subplots are finished and then use the form that includes the handle to one of the axes (likely the 2nd would be a good candidate at the upper RH corner, I'm guessing). Then try
hL=legend(hA(2), ..., 'BestOutside');
and see if that suits. It's quite a large legend box so you may decide it's better to reduce the size of the axes a little to make a little room outside. That's the 'position' property of the axes.
Fabio
on 4 Jun 2014
Fabio
on 4 Jun 2014
dpb
on 4 Jun 2014
Several threads on the subject recently...
There's a link to a File Exchange submission in my answer at the first link above -- I've not used it so no direct knowledge altho it's got good ratings...
Fabio
on 4 Jun 2014
Answers (0)
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
