findlast.m

来自「JLAB is a set of Matlab functions I have」· M 代码 · 共 18 行

M
18
字号
function[a]=findlast(bool)%FINDLAST  Finds the last incidence of X==1; returns 0 if all false.%   _________________________________________________________________%   This is part of JLAB --- type 'help jlab' for more information %   (C) 2002, 2004 J.M. Lilly --- type 'help jlab_license' for details  if isempty(bool)  error('Argument cannot be empty');endtemp=find(bool);if ~isempty(temp)   a=max(temp);else    a=0;end      

⌨️ 快捷键说明

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