Why does App Designer include the full file path when packaging external helper functions?

조회 수: 1 (최근 30일)
I am trying to create a GUI for some existing code I wrote using the MATLAB App Designer. The app relies on some external helper functions that I wrote in MATLAB program files and they are correctly identified as necessary to include; however, when packaged it includes the entire file path of the matlab function files within the installed package. This means that after installing the app, for example, tallySum.m ends up stored in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/Users/rhysg/Documents/YPGRA/TIRF_ProcessingCode/tallySum.m" instead of just placing it in "/Users/rhysg/Library/Application Support/MathWorks/MATLAB Add-Ons/Apps/NNB_GUI/tallySum.m"
This doesn't cause functional problems but it does not seem intended and I was wondering if it could be avoided. Other than copying all the functions directly into the app is there a way to fix this? Is there a reason it functions in this way? Is there somewhere else to look for information on this?
Thanks in advance.

채택된 답변

Kanishk
Kanishk 2024년 9월 30일
Hey Rhys,
I understand the helper function files in the installed package contain the entire path of the MATLAB function files. In the official MATLAB documentation, it is mentioned that
“When you include files that are in a folder other than the current MATLAB working folder, the partial file path is preserved in the deployable archive relative to ctfroot.”
Here, "ctfroot" refers to the folder where the deployable archive for the application is expanded.
To streamline the file paths within your installed package, you can either
  • Move all the necessary files into the current working directory. You can create subfolders within this directory to maintain organization.
  • Or change the working directory to a higher-level directory that encompasses all the relevant files. This ensures that the paths are more concise and manageable within the deployable archive.
Please go through this official MATLAB documentation to learn more.
Thanks
Hope this helps
  댓글 수: 1
Rhys
Rhys 2024년 9월 30일
Thanks. That seems to have resolved the issue. All my files were already in the same folder but it must not have been selected as my current working directory when I was packaging the app.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

제품


릴리스

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by