THMMY's "Optimization Techniques" course assignments.
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
800 B

  1. function plotIterationsOverGamma(gamma, iterations, plot_title, filename)
  2. % 3D plots a function
  3. % fun: The points to plot
  4. % contur_fun: The function for contour plot
  5. % x_lim: The range for x axis. ex: [-2, 2]
  6. % y_lim: The range for y axis. ex: [0, 2]
  7. % size: The number of points for each axis
  8. % plot_title: The latex title for the plot
  9. % filename: The filename to save the plot (if exists)
  10. %
  11. figure('Name', 'Iterations_over_gamma', 'NumberTitle', 'off');
  12. set(gcf, 'Position', [100, 100, 960, 960]); % Set the figure size
  13. plot(gamma, iterations, '*r', 'LineWidth', 2);
  14. title(plot_title, 'Interpreter', 'latex', 'FontSize', 16); % Title of the plot
  15. xlabel('\gamma') ;
  16. ylabel('Iterations');
  17. print(gcf, filename, '-dpng', '-r300');
  18. end