How to open any file in GUI?

If i want to make some GUI and there is a push button. And i want that button to open a specific file saved on my hard disk.
And is it possible to merge any file in GUI, i.e. i want the specific area of GUI to open my c++ program code with a push button.

7 commentaires

Jan
Jan le 29 Jan 2013
Modifié(e) : Jan le 2 Fév 2013
Please explain what you have tried so far and which problems occurred. Actually you need only a LOAD or another command for reading in the callback function of the button.
I do not see the relation between "merge any file" and "open my c++ program code".
Image Analyst
Image Analyst le 29 Jan 2013
Define "open". Do you want to call/run/execute the code? Do you want to open it as text and display the source code in a text box on the GUI? Is that what "merge any file in GUI" means?
Raxeee
Raxeee le 2 Fév 2013
from MERGE i mean that it should be opened on some specific area of window area of GUI.
ok i want to open any file and display its content on that area. And is it different for different programs like if i want to open c++,excel,word,video,program.
Jan
Jan le 2 Fév 2013
@Raxeee: I cannot follow you. Do you want to open a c++ source code file, an excel/word and movie file and even another program in a specific area of a Matlab GUI? Perhaps you are asking for ActiveX controls, or perhaps it is absolutely impossible what you are talking of.
Raxeee
Raxeee le 3 Fév 2013
okay. one c++ code and one excel file having three sheets.
Image Analyst
Image Analyst le 3 Fév 2013
What was wrong with my answer? It will display your c++ code. You could then use xlsread() to read in the workbook and then also send that to a table or text label in your GUI with set().
Jan
Jan le 3 Fév 2013
@Raxeee: If you want us to spend more time for finding a solution, you could spend more time to explain, what you are exactly looking for. There is no chance to guess how you want to display "one Excel file with three sheets" and why you want to do this in Matlab, wlthough it is trivial in Excel.

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 29 Jan 2013

0 votes

How about using fopen(), fgetl() or fgets(), and fclose()? Then use
set(handleToTextBox, 'String', theText);
to send the text you read in to the GUI.

Catégories

Question posée :

le 29 Jan 2013

Community Treasure Hunt

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

Start Hunting!

Translated by