Read the current exe file name after compiling

Hello everyone,
I converted an m file to exe, and it(exe) creates a copy of its own with different name. According to their name, they should do different tasks. Now when I try to run the exe file with 'mfilename' it reads the original m file name, not the exe file name. Can anyone show me the right direction?
Thanks

댓글 수: 3

Rik
Rik 2021년 11월 4일
I have no clue whether it is even worth trying, but what does matlabroot return in a compiled application?
Since compiled applications will unzip to a temporary folder, I don't know whether it is even possible in the first place to retrieve the file name.
Mubin R
Mubin R 2021년 11월 4일
No, it's showing matlab version name
I think that the problem is in which way you create your exe file: probably creating a standalone app will solve your problem.

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

 채택된 답변

Mubin R
Mubin R 2021년 11월 5일

0 개 추천

Found a solution
a= Environment.GetCommandLineArgs;
b=string(a)
it gives the current exe file name

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

질문:

2021년 11월 4일

답변:

2021년 11월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by