代码拉取完成,页面将自动刷新
function video_name = choose_video(base_path)
%CHOOSE_VIDEO
% Allows the user to choose a video (sub-folder in the given path).
%
% Joao F. Henriques, 2014
% http://www.isr.uc.pt/~henriques/
%process path to make sure it's uniform
if ispc(), base_path = strrep(base_path, '\', '/'); end
if base_path(end) ~= '/', base_path(end+1) = '/'; end
%list all sub-folders
contents = dir(base_path);
names = {};
for k = 1:numel(contents),
name = contents(k).name;
if isdir([base_path name]) && ~any(strcmp(name, {'.', '..'})),
names{end+1} = name; %#ok
end
end
%no sub-folders found
if isempty(names), video_name = []; return; end
%choice GUI
choice = listdlg('ListString',names, 'Name','Choose video', 'SelectionMode','single');
if isempty(choice), %user cancelled
video_name = [];
else
video_name = names{choice};
end
end
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。