Effacer les filtres
Effacer les filtres

Running two scripts containing different functions consecutively

2 vues (au cours des 30 derniers jours)
LS
LS le 19 Mai 2011
Hi, I need to run two scripts (containing two different functions) consecutively and I'm wondering if there's a way to write a separate script or something that will run the first function and then run the second automatically. The second script uses variables found in the first. As of now, I'm running the first script, waiting for it to complete, and then running the second. Is there a way to set up a for loop or something so that Matlab will do that for me? And further, I'm trying to see the effect of changing the value of one parameter on the equilibrium values of the system. Can I write something so Matlab runs the sequence of scripts for a range of values for this parameter and loads the equilibrium values (the final values of the functions) into a matrix or spreadsheet or something? Sorry this is may be confusing - any help with any part of this process would be very much appreciated!
  1 commentaire
Sean de Wolski
Sean de Wolski le 19 Mai 2011
If you want a more detailed response than below, provide a (small) example of inputs/operations/outputs.

Connectez-vous pour commenter.

Réponse acceptée

Sean de Wolski
Sean de Wolski le 19 Mai 2011
Of course!
stuff = magic(4); %example stuff
[x y] = function1(stuff); %call first function
[z] = function2(x,y); %then call next one

Plus de réponses (0)

Catégories

En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by