Mercurial > repos > public > sbplib
comparison isAnyOf.m @ 583:75f9b7a80f28 feature/grids
Allow more than one type in type assertion
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 07 Sep 2017 14:08:31 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
582:ce44af8d7dd1 | 583:75f9b7a80f28 |
---|---|
1 % Returns true of obj is any of he types in the cell array types | |
2 % b = isAnyOf(obj, types) | |
3 function b = isAnyOf(obj, types) | |
4 for i = 1:length(types) | |
5 if isa(obj, types{i}); | |
6 b = true; | |
7 return | |
8 end | |
9 end | |
10 b = false; | |
11 end |