26 lines
588 B
Matlab
26 lines
588 B
Matlab
classdef LinearBounds
|
|
%LINEARBOUNDS Summary of this class goes here
|
|
% Detailed explanation goes here
|
|
|
|
properties
|
|
lower double
|
|
higher double
|
|
end
|
|
|
|
methods
|
|
function obj = LinearBounds(lowerIn,higherIn)
|
|
obj.lower = lowerIn;
|
|
obj.higher = higherIn;
|
|
end
|
|
|
|
function outputArg = length(obj)
|
|
outputArg = abs(obj.higher-obj.lower);
|
|
end
|
|
|
|
function outputArg = getRandomValue(obj)
|
|
outputArg = obj.lower + (rand() * obj.length);
|
|
end
|
|
end
|
|
end
|
|
|