Montecarlo Matlab

This commit is contained in:
Parric007
2024-05-13 12:09:59 +02:00
commit 4a0994aceb
4 changed files with 111 additions and 0 deletions

25
LinearBounds.m Normal file
View 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