fn_find
Contents
Syntax
idx = fn_find(fun,A[,'first|last|all|any'][,'columns|rows']) idx = fn_find(A,fun[,'first|last|all|any'][,'columns|rows']) idx = fn_find(x,A[,'first|last|all|any'][,'columns|rows']) idx = fn_find(A[,'first|last|all|any'][,'columns|rows'])
Description
Map function fun to elements[default]/columns/rows of A and find the first/last/all[default] elements that returned non-empty/non-zero elements (or, if 'any' flag is employed, returns a logical indicating whether the function returned true at least once)
if no function handle is passed but any matlab variable x, the function fun = @(y)isequal(y,x) is used, i.e. fn_find looks for occurences of x inside A
if only A is provided, function fun = @(y)~isempty(y) is used, i.e. fn_find looks for non-empty elements in A, which typically is a cell array
See also fn_map, fn_isemptyc
Source
Thomas Deneux
Copyright 2016-2017