comparison +blockmatrix/isDivision.m @ 211:3c4ffbfbfb84 feature/beams

Merged feature/grid into feature/beams
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 16 Jun 2016 10:56:47 +0200
parents 764438b52541
children a5f1b0267dba
comparison
equal deleted inserted replaced
200:ef41fde95ac4 211:3c4ffbfbfb84
1 function b = isDivision(div)
2 % Make sure it is a cellarray
3 if ~iscell(div)
4 b = false;
5 return
6 end
7
8 % Make sure it has the right shape
9 if numel(div) ~= 2
10 b = false;
11 return
12 end
13
14 if ~isDivisionVector(div{1}) || ~isDivisionVector(div{2})
15 b = false;
16 return
17 end
18
19 b = true;
20 end
21
22 function b = isDivisionVector(v)
23 if isempty(v)
24 b = false;
25 return
26 end
27
28 if any(v <= 0)
29 b = false;
30 return
31 end
32
33 b = true;
34 end