function [x,y] = GetLine(weights, weightsSupervised, bias, startX, endX, k) x = startX:0.001:endX; y = zeros(1, length(x)); yStart = 0; input = GetG(weights, [startX yStart],k); startValue = RunNetwork(input, weightsSupervised, bias); hasSwitched = false; for i = 1:length(x) while ~hasSwitched if startValue < 0 yStart = yStart + 0.001; input = GetG(weights, [x(i), yStart],k); output = RunNetwork(input, weightsSupervised, bias); if sign(output) ~= sign(startValue) hasSwitched = true; end else yStart = yStart - 0.01; input = GetG(weights, [x(i), yStart],k); output = RunNetwork(input, weightsSupervised, bias); if sign(output) ~= sign(startValue) hasSwitched = true; end end end y(i) = yStart; hasSwitched = false; startValue = output; end end