📄 fm_filenum.m
字号:
function nome = fm_filenum(varargin)% FM_FILENUM determine names for output report files.% Files are number from 00 to 99.% After the 99th file is created, file 00% is rewritten without asking foir permission.%% NAME = FM_FILENUM(EXT)% EXT string defining the file extension% NAME resulting file name%%Author: Federico Milano%Date: 11-Nov-2002%Version: 1.0.0%%E-mail: fmilano@thunderbox.uwaterloo.ca%Web-site: http://thunderbox.uwaterloo.ca/~fmilano%% Copyright (C) 2002-2005 Federico Milano%% This toolbox is free software; you can redistribute it and/or modify% it under the terms of the GNU General Public License as published by% the Free Software Foundation; either version 2.0 of the License, or% (at your option) any later version.%% This toolbox is distributed in the hope that it will be useful, but% WITHOUT ANY WARRANTY; without even the implied warranty of% MERCHANDABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU% General Public License for more details.%% You should have received a copy of the GNU General Public License% along with this toolbox; if not, write to the Free Software% Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,% USA.global File Pathif nargin == 1 extension = varargin{1}; nome = strrep(File.data,'(mdl)',''); if strcmp(nome([1:2]),'@ '), nome = nome(3:end); end counter = 1; numero = '_01'; while exist([Path.data,nome,numero,'.',extension]) == 2 counter = counter + 1; if counter < 10 numero = ['_0',int2str(counter)]; elseif counter < 100 numero = ['_',int2str(counter)]; else numero = '_01'; break end end nome = [nome, numero];elseif nargin == 2 nome = varargin{1}; % check for Matlab operators within function name list = {'+','-','*','/','\','.','@','%','$', ... '|','!','(',')','=','>','<','[',']', ... '#','&','{','}','?',':',',',';','"', ... '~','^',' ',''''}; for i = 1:length(list) nome = strrep(nome,list{i},'_'); endend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -