How to create inputdlg for running program by its path?
3 次查看(过去 30 天)
显示 更早的评论
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.
0 个评论
采纳的回答
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
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Sources 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!