How to Open a Folder
122 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hey.
I need help trying to open a folder on matlab while the code is running. I want the folder to open as a response to the user clicking on the screen. I already have the folder in the same pathway as the overall code, I'm just having trouble with the syntax and general terminology to open a specfic folder.
11 Commenti
Walter Roberson
il 12 Apr 2021
[filename,filepath] = uigetfile('*.mov');
if isempty(filename)
%user cancel, handle appropriately here
end
fullname = fullfile(filepath, filename);
open(fullname)
Using path as the name of a variable is not recommended as path controls the MATLAB search path.
Risposte (1)
Jan
il 11 Apr 2021
Modificato: Jan
il 11 Apr 2021
Maybe you want to open a file inside this folder?
function main
myPath = fileparts(mfilename('fullpath')); % Folder of this M-file
Folder = fullfile(myPath, 'NameOfSubfolder'); % Subfolder inside
Data = load(fullfile(Folder, 'YourData.mat')); % A specific file there
...
end
0 Commenti
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

