Function finished to going to next

How i make sure that the function 1 is completely finished and the function 2 will be started normally in the second ordre after the 1. Thanks

2 comentarios

Walter Roberson
Walter Roberson el 7 de Abr. de 2013
Is this referring to the parallel toolkit ?
Lila wagou
Lila wagou el 8 de Abr. de 2013
Thanks for the comment, for a pre-processing with an external programme i used the matlab function 1 and for its post-processing i used the function 2, for an logical fonctionnement for my matlab program i must provide a wait for the second function until the sure finish of the first one, please any suggestion ?

Iniciar sesión para comentar.

Respuestas (2)

Jan
Jan el 8 de Abr. de 2013

0 votos

You cannot control the activity of an external program from inside Matlab reliably. A soltuion would be to allow the external program to set a kind of flag, when it is finished, e.g. writing certain data to a specific file. Do you have an access to the external program?

2 comentarios

Lila wagou
Lila wagou el 10 de Abr. de 2013
Thanks, When it is finished; the external program write 'Completed Treatment' in a specific file 'xx.dat', is there any way to provide a wait for the second function until the sure reading inside the 'xx.dat' the 'Completed Treatment' expression ?
Lila wagou
Lila wagou el 12 de Abr. de 2013
Please, any help

Iniciar sesión para comentar.

Walter Roberson
Walter Roberson el 8 de Abr. de 2013

0 votos

if you use system() to invoke the external program, then if the program does not start up graphics windows, then system() will not return until the program finishes.

5 comentarios

Lila wagou
Lila wagou el 10 de Abr. de 2013
Thanks, i have not any idea about the system(), for my invoking i use the eval function. Please can you explain more ?
Walter Roberson
Walter Roberson el 10 de Abr. de 2013
Please show the code you use for starting the program.
Is the external program one that starts up a GUI?
Lila wagou
Lila wagou el 10 de Abr. de 2013
The external program does not starts up a GUI it is a dos command with an input file for an output file.
The starting up is identical to: eval(['!notepad ']) for notepad invoking.
Lila wagou
Lila wagou el 12 de Abr. de 2013
Please, any help
Walter Roberson
Walter Roberson el 12 de Abr. de 2013
I do not know what notepad is in this context.
If you are using eval() of a '!' string, then instead use system() of the string without the leading '!'.
When you use ! or system() of a command that does not start a GUI, then control does not return to MATLAB until the command completes.

Iniciar sesión para comentar.

Categorías

Más información sobre Entering Commands en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 7 de Abr. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by