Borrar filtros
Borrar filtros

Display value of a variable within ' '

1 visualización (últimos 30 días)
Esma Ozer
Esma Ozer el 25 de Sept. de 2021
Comentada: Esma Ozer el 25 de Sept. de 2021
Hi,
I am trying to call Stata within Matlab with the following command. run_id is the argument I am passing to stata as an index.
My question is: this run_id can take different values like 1,2,3,.... how to display the value of the run_id within ' ' such that the do-file take these values as argument. I checked but couldn't find a corresponding answer. Thanks, in advance!
system([stata_location ' -b do mydir/mydofile run_id']);

Respuestas (1)

Chunru
Chunru el 25 de Sept. de 2021
system([stata_location ' -b do mydir/mydofile ' num2str(run_id)]);
  1 comentario
Esma Ozer
Esma Ozer el 25 de Sept. de 2021
No, actually this doesn't solve the problem. because it is changing the name of the do file to mydofilerun_id.do.
Thanks, though.

Iniciar sesión para comentar.

Categorías

Más información sobre Get Started with Optimization Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by