function [ hist_h, hist_x ] = solution_stability( q_0, q_final, x_final, optics_positions, optics_focal_length, lambda ) %SOLUTION_STABILITY Summary of this function goes here % Detailed explanation goes here n = 10000; lens_displacement = 10^-3; x = lens_displacement*randn(n,3); for i=1:n xd= x(i,:); fitness_array(i) = fitness( q_0, q_final, x_final, optics_positions + xd, optics_focal_length, lambda ); end [hist_h, hist_x] = hist(fitness_array,100); end