% Input:
% leftbound: double (lower bound on the interval)
% rightbound: double (upper bound on the interval)
% input: string

% Output:
% x: bool (true if transformation has been done successfull)
% v: double (value contained in the input string)


% Description:
% Checks if a double value given via input as string is in the interval
% [leftbound,rightbound] and transforms the input string in this case to a
% double value.

% Beschreibung:
% prüft ob input ein Double im Intervall [leftbound,rightbound] ist. Falls
% ja ist x true und v enthält den konvertierten Wert.

function [x,v] = checkDoubleInput(leftbound,rightbound,input)
v = str2double(input);
if isnan(v) || isempty(v)
    x = false;
else
    if leftbound <= v && v <= rightbound
        x= true;
    else
        x = false;
    end;
end;