ismname.m
来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 33 行
M
33 行
function[b]=ismname(x)%ISMNAME Tests whether a string is an m-file name; cells OK %% ISMNAME STR tests whether a string STR has the ending ".m".%% ISMNAME(X) where X is a cell array of strings returns a boolean% array testing whether each string has the ending ".m".% _________________________________________________________________% This is part of JLAB --- type 'help jlab' for more information % (C) 2002, 2004 J.M. Lilly --- type 'help jlab_license' for details if iscell(x) for i=1:length(x) b(i)=ismname1(x{i}); endelse b=ismname1(x);endfunction[b]=ismname1(x) x=deblank(x);if length(x)>=2 b=strcmp(x(end-1:end),'.m');else b=0;endif strcmp(x(1),'#') || strcmp(x(1),'.') %Exclude funny names b=0;end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?