Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

GUI's use

1 Ansicht (letzte 30 Tage)
Abbass SAYEGH
Abbass SAYEGH am 2 Jul. 2020
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
Hello everyone,
I am there because i work on a project with graphic interface. I need help.
In fact, I need in my interface two buttons, one which allows just to select a file (xlsx, png) without opening it, and a second which allows to open the desired file.
so far i have only one button that selects and opens the file, but i need two in my GUIDE interface
Thank you!

Antworten (1)

Image Analyst
Image Analyst am 2 Jul. 2020
Try this
For the first function callback, you can call uigetfile:
% Have user browse for a file, from a specified "starting folder."
% For convenience in browsing, set a starting folder from which to browse.
startingFolder = pwd; % or 'C:\wherever';
if ~isfolder(startingFolder)
% If that folder doesn't exist, just start in the current folder.
startingFolder = pwd;
end
% Get the name of the file that the user wants to use.
defaultFileName = fullfile(startingFolder, '*.*');
[baseFileName, folder] = uigetfile(defaultFileName, 'Select a file');
if baseFileName == 0
% User clicked the Cancel button.
return;
end
fullFileName = fullfile(folder, baseFileName)
For the second function, you can call
winopen(fullFileName);
Attach your .-file and fig-file if you still need more help.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by