Display value of a variable within ' '

조회 수: 1 (최근 30일)
Esma Ozer
Esma Ozer 2021년 9월 25일
댓글: Esma Ozer 2021년 9월 25일
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']);

답변 (1개)

Chunru
Chunru 2021년 9월 25일
system([stata_location ' -b do mydir/mydofile ' num2str(run_id)]);
  댓글 수: 1
Esma Ozer
Esma Ozer 2021년 9월 25일
No, actually this doesn't solve the problem. because it is changing the name of the do file to mydofilerun_id.do.
Thanks, though.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by