How can I open an external application from Matlab app designer

8 ビュー (過去 30 日間)
Jonathan Salazar
Jonathan Salazar 2018 年 4 月 13 日
コメント済み: Jonathan Salazar 2018 年 4 月 14 日
I am Working on an app that creates a data file to be used VMD ( visual molecular dynamics). The app creates the data file which I then want to be opened in VMD. I have included input for the users path to VMD but I am unsure of the syntax to directly open the file in vmd. I've been using something like:
system(strcat(char(VMD_path),char(strcat({' '},'TEST.xyz'))));
which only opened vmd and gave an error for the file. I changed some things around and now none of it works. For reference, my path was input exactly as "C:\Users\Jonathan\Desktop\VMD 1.9.3.lnk" when it did work. I am a newbie when it comes to matlab so any help is very much appreciated! lastly does location of the file in matlab matter? the file seems to be created in whatever directory that is open in matlab. thank you!

採用された回答

Chris Portal
Chris Portal 2018 年 4 月 14 日
Your system is not going to know where your test data file lives, so you need to provide it more than just the name and extension to it. If it’s being created in the current MATLAB directory, then you can try something like this:
fTest = fullfile(pwd, TEST.xyz);
cmd = [VMD_path ‘ ‘ fTest];
system(cmd)
Note, your VMD path is to the lnk file, which is an OS shortcut to the actual executable. You may need to use the actual location of the executable file rather than its shortcut.
  1 件のコメント
Jonathan Salazar
Jonathan Salazar 2018 年 4 月 14 日
Thank you for your response! This works perfectly to open VMD but still does not open the file in the app. I think i gave you the wrong location of the output file. It is created in the current matlab folder that the user is working in.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by