-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsize_grid.m
33 lines (27 loc) · 879 Bytes
/
size_grid.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
classdef size_grid
% size grid of a solution
properties
lowBound
highBound
nPoints
end
methods
function obj = size_grid(highBound, nPoints)
obj.lowBound = 0;
obj.highBound = highBound;
obj.nPoints = nPoints;
end
function a = to_array(obj)
% Get the column vector format of the grid.
% numel(obj) must equal 1.
a = linspace(obj.lowBound, obj.highBound, obj.nPoints)';
end
function ret = interval(obj)
% Get the grid interval in um
ret = ([obj.highBound] - [obj.lowBound]) ./ ([obj.nPoints] - 1);
end
function equality = eq(obj1, obj2)
equality = obj1.highBound == obj2.highBound && obj1.interval == obj2.interval;
end
end
end