How to save a GUI In Way that you can run it from another PCs?

조회 수: 3 (최근 30일)
Mahdi
Mahdi 2011년 5월 26일
How to save a GUI In Way that you can run it from another PCs? I have created a GUI as a project and I want to give to my master. but it can't be run by double clicking on it. it can be run just by opening GUIDE and opening the GUI from that box.

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 5월 26일
If your master (teacher, professor?) has Matlab, he should be able to run the .m file corresponding to your GUI application. You could also give him the .p file so he can double click the .p file in Matlab to run it.
help pcode
If your master does not have Matlab, you can compile your GUI application to an .exe file so it can be run on any computer. You need to have the Matlab Compiler Toolbox to do it.
help mcc
help deploytool
  댓글 수: 2
Mahdi
Mahdi 2011년 5월 26일
Thank, you
yes he has matlab.
But I have the .fig file and the .m file how can i make a .p file?
i have searched pcode but i couldn't use it to make a .p file.
would you mind giving the code?
Thanks again
Fangjun Jiang
Fangjun Jiang 2011년 5월 26일
pcode is provided with Matlab. Like Matt said, by default, you'll have mygui.fig and mygui.m files. Give both files to your master, he should be able to type 'mygui' in Matlab to run it. If he double clicks mygui.m, by default, it will open the mygui.m file for editing. If he's too lazy and wants to double click. You can run 'pcode mygui' then copy mygui.p and mygui.fig to him. He can double click mygui.p to run it.

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

추가 답변 (2개)

Todd Flanagan
Todd Flanagan 2011년 5월 26일
You can redistribute MATLAB code and Guide guis using the MATLAB Compiler. This will give the other user something he can double click on and run if he does not have MATLAB installed on his computer.
  댓글 수: 1
Walter Roberson
Walter Roberson 2011년 5월 26일
Note: the MATLAB Compiler is not available for MATLAB Student Edition.

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


Matt Fig
Matt Fig 2011년 5월 26일
I don't understand what you mean "it can only be run by opening GUIDE."
That is not correct, unless there is something wrong. You should be able to type the name of the GUI at the MATLAB command line and cause it to open. So if you give both of the M-file and FIG-file to your master, he should be able to run it by putting the files in his local directory then typing the name of the GUI.
  댓글 수: 2
Mahdi
Mahdi 2011년 5월 26일
I mean the only way i can run it is typing GUIDE in Command Window and the open the .fig file.
No i should give him a file which is easily able to run.
Matt Fig
Matt Fig 2011년 5월 26일
Again, this is not correct unless the GUI is broken. If the name of your GUI M-file is mygui.m, then you should be able to run it from the command line by typing:
mygui
Assuming both files are in the current directory.

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

카테고리

Help CenterFile Exchange에서 MATLAB Compiler에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by