for i=1:5 optics_position = possible_lens_placement(i,:); optics_set = possible_lens_set(i,:); [hist_h, hist_x] = solution_stability( q0, qf, xf, optics_position, optics_set, lambda ); plot(hist_x, hist_h); end