diff options
Diffstat (limited to 'energy_vs_stability.m')
-rw-r--r-- | energy_vs_stability.m | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/energy_vs_stability.m b/energy_vs_stability.m index 796c631..1915449 100644 --- a/energy_vs_stability.m +++ b/energy_vs_stability.m @@ -1,10 +1,22 @@ function [] = energy_vs_stability( possible_energy, stability, index, stability_max ) -%ENERGY_VS_STABILITY Summary of this function goes here -% Detailed explanation goes here +%Plots energy vs. stability +% Using data sent from mode_match, this function plots energy vs. +% stability of each solution for eyed comparisons. n = size(stability,2); - c = 1:n; + %Color code data points + if n == 3 + c = [1, 0, 0; 0, 1, 0; 0, 0, 1]; + elseif n == 2 + c = [1, 0, 0; 0, 1, 0]; + elseif n == 1 + c = [1, 0, 0]; + else + c = 1:n; + end + + %Reorganize stability to coincide with energies for i=1:n fixed_stability(i,1) = stability(i); end @@ -13,6 +25,7 @@ function [] = energy_vs_stability( possible_energy, stability, index, stability_ energy(i,1) = possible_energy(index(i)); end + %Graph scatter plot figure(n+1) textCell = arrayfun(@(x,y) sprintf('(%3.2f, %3.2f)',x,y),energy,fixed_stability,'un',0); scatter(energy,fixed_stability,25,c,'filled') @@ -23,13 +36,11 @@ function [] = energy_vs_stability( possible_energy, stability, index, stability_ dx =0.0000000005; dy =0.0000000005; + %Label data points relative to solution number for i = 1:n n_solution = num2str(i); text(energy(i)+dx, fixed_stability(i)+dy, n_solution, 'FontSize',10); end -% for i = 1:n -% text(energy(i), fixed_stability(i), textCell{i}, 'FontSize',8) -% end - + end |