How to create inputdlg for running program by its path?

조회 수: 3 (최근 30일)
Veronika
Veronika 2017년 3월 14일
댓글: Veronika 2017년 3월 16일
Dear all,
I need create inputdlg (window) for loading program (EIDORS) path and after that run this path. I tried this code, but I didn´t success.
prompt={'Zadejte svou adresu pro spuštění EIDORS:','z'};
name = 'Spuštění EIDORS';
defaultans = {'C:/Users/ced0005/eidors-v3.8-ng/eidors/startup.m'};
answer = inputdlg(prompt,name,defaultans);
Can you advise me? Thank you for your answers.

채택된 답변

ES
ES 2017년 3월 16일
Your 'answer' is of type cell.
so do it this way,
prompt={'Zadejte svou adresu pro spuštění EIDORS:'};
name = 'Spuštění EIDORS';
defaultans = {'C:/Users/ced0005/eidors-v3.8-ng/eidors/startup.m'};
numlines = 1;
answer = inputdlg(prompt,name,numlines, defaultans);
run(answer{1})

추가 답변 (1개)

ES
ES 2017년 3월 14일
편집: ES 2017년 3월 14일
You have two arguments in prompt. 1.'Zadejte svou adresu pro spuštění EIDORS:' and 2.'z'
but only one default value in defaultans
I think you would want
prompt={'Zadejte svou adresu pro spuštění EIDORS:'};
name = 'Spuštění EIDORS';
defaultans = {'C:/Users/ced0005/eidors-v3.8-ng/eidors/startup.m'};
numlines = 1;
answer = inputdlg(prompt,name,numlines, defaultans);
  댓글 수: 3
ES
ES 2017년 3월 15일
You should be able to run with this code. Are you getting any error?
Veronika
Veronika 2017년 3월 15일
Yes it runs, but I would like to run this path:C:/Users/ced0005/eidors-v3.8-ng/eidors/startup.m, which I wrote into the defaultans for starting and opening program EIDORS.

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

카테고리

Help CenterFile Exchange에서 Sources에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by