Montecarlo Matlab
This commit is contained in:
25
LinearBounds.m
Normal file
25
LinearBounds.m
Normal file
@@ -0,0 +1,25 @@
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user