THMMY's "Optimization Techniques" course assignments.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

plotItersOverGamma.m 997 B

пре 3 дана
пре 5 дана
пре 3 дана
пре 5 дана
пре 5 дана
пре 5 дана
12345678910111213141516171819202122232425262728
  1. function plotItersOverGamma(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. global image_width,
  12. global image_height;
  13. figure('Name', 'Iterations_over_gamma', 'NumberTitle', 'off');
  14. set(gcf, 'Position', [100, 100, image_width, image_height]); % Set the figure size
  15. plot(gamma, iterations, '*r', 'LineWidth', 2);
  16. % Customize the plot
  17. title(plot_title, 'Interpreter', 'latex', 'FontSize', 16); % Title of the plot
  18. xlabel('\gamma') ;
  19. ylabel('Iterations');
  20. % save the figure
  21. if strcmp(filename, '') == 0
  22. print(gcf, filename, '-dpng', '-r300');
  23. end
  24. end