Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to make .fig files private?

조회 수: 1 (최근 30일)
Han Peng
Han Peng 2015년 4월 21일
마감: MATLAB Answer Bot 2021년 8월 20일
Hello all.
I created a 'private' folder and put all my functions called by the main program to that folder. It works well with functions that have no GUI or with functions whose GUI are developed purely by coding. But it fails with GUIs developed by GUIDE, which contain both .m files and .fig files.
Take 'general_plot_demo.m' as an example. It is developed by GUIDE, and has a corresponding .fig file.
When I try to run it, error massage comes out like this:
Error using load
Unable to read file 'general_plot_demo.fig'. No such file
or directory.
Since I want to load .fig files while do not want .fig files to be seen from outside, could there be a proper way to make .fig files private?
Thank you very much!

답변 (1개)

Cindy Solomon
Cindy Solomon 2015년 4월 22일
Hi Han,
This is a limitation of MATLAB wherein GUI's in a private directory or directories starting with '@' do not work properly even if the full path information is used. This is due to the fact that MATLAB files under a private directory can only be seen by MATLAB code in function files immediately above the private directory. Callbacks (including CreateFcn) do not work properly both in startup and when running. To work around this issue, place the MATLAB file and the FIG file in a directory that is on your MATLAB path.
For more information on saving GUIDE UIs, please see this link, as well as this one that explains the scope of private functions. Hope this helps!

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by