📄 choose_path_and_file.m
字号:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% A very useful menu generator for a certain type of files
% By using this program, you can choose the path, and the file you want to
% run.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
path = uigetdir;% Choose path
string = [path '\'];%
dirname = string;
dir_names = what(dirname);% find all the files under the certain path
matfiles = dir_names.mat;%choose all the MAT files
Savedname=[]
cd (dirname)% enter the path
INPUT1 = menu('Please select your .mat file', matfiles{1:end}, 'CANCEL');% show the mat files menu
if INPUT1 ~= (length(matfiles) + 1) % if the customer not equal to the "Cancel", the system will choose the run the selected files.
Filename = matfiles{INPUT1};
disp('#############################################');
disp(['Begin to load ' Filename ' into workspace...']);
else
close all; % if choose to cancel the file, the system will be closed
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -