Compiler - making standalone file

조회 수: 1 (최근 30일)
Mehdi
Mehdi 2013년 8월 14일
Folks, I made a standalone, executable file of my code using deploytool and it works fine. However, it doesn't run four sorts of functions which contain path (for example: C:/.../myfolder). The functions that it can't run are:
  1. publish(c:/.../myfolder)
  2. open(c:/.../myfolder)
  3. system(c:/.../myfolder)
  4. delete(c:/.../myfolder)
It does run the plot though. My matlab is 2012a. These abovementioned features are essential elements of the code and I really need to run them without having to manipulate or remove them. Is there anyway that I can resolve this problem? You time and help will be much appreciated.

채택된 답변

Walter Roberson
Walter Roberson 2013년 8월 14일
No, you cannot resolve the problem without changing what you have.
When you run an executable, then unless you change the Properties in the icon you use to launch it with, the executable with start executing in a directory that is created on the fly to hold the unpacked components of the standalone. The executable will not generally start from the directory that you are in at the time that you click to launch the executable.
Even if you were in the correct directory, when you deploy to somewhere else, they will not generally have whatever executables or scripts that you have stored in your folder that you are using system() on. Not unless you have included them in the deployment and copy them to the appropriate place.
Please have a look at ctfroot()
  댓글 수: 2
Friedrich
Friedrich 2013년 8월 14일
Besides from that correct answer from Walter a small additional note. The function "publish" is one of the functions which cannot be compiled. So your standalone needs to get rid of the publish calls.
Mehdi
Mehdi 2013년 8월 14일
Friedrich - That'll be problematic because most of the output of my code is in the form of html pages containing English texts, data and plots. Is there any alternative method to use instead of 'publish' or the other functions I mentioned yet be able to generate similar outputs, not necessarily html or pdf? Thanks a lot in advance.

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

추가 답변 (1개)

Mehdi
Mehdi 2013년 8월 14일
Thank you Walter. I did take a look at ctfroot() and some related pages. I still have some questions. How can I change the Properties in the icon that I use to launch the standalone? This is how I actually made the standalone: I prompted deploytool in the command window, and in the GUI, I changed the ‘untitled.prj’ to the name of the main *.m file and located it in that same folder where all the codes and files are. Then I added the main *.m file and separately everything else. Then I used ‘package’. I followed this video: Ke599czEmxU&list=FLXS_hauO3PHwFPXqeIfyM3g&index=19 A folder is created with two other folders inside it: distrib and src. I run the exe file which is inside the distrib. Am I on the right track? Thank you for your continued help.

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by