basename.m

来自「显著区域检测。求的图像中感兴趣区域的位置」· M 代码 · 共 38 行

M
38
字号
% basename strips filename of directory and file extension.%% bname = basename(filename) %    Removes everything before the right-most occurrence %    of the path delimiter PD, and everything after the %    left-most occurrence of a dot.% This file is part of the SaliencyToolbox - Copyright (C) 2006-2007% by Dirk B. Walther and the California Institute of Technology.% See the enclosed LICENSE.TXT document for the license agreement. % More information about this project is available at: % http://www.saliencytoolbox.netfunction bname = basename(filename)declareGlobal;slash = find(filename == PD);if isempty(slash)  left = 1;else  left = slash(end)+1;enddot = find(filename == '.');if isempty(dot)  right = length(filename);else  right = dot(end)-1;endif (left > right)  bname = filename(left:end);else  bname = filename(left:right);end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?