-
-
Save RenolY2/9adb142fc923979e896701dc47f08082 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MAX = 10 | |
SCALE = 50 | |
x_vals = [1*SCALE:MAX*SCALE]/SCALE; | |
y_vals = arrayfun(@(x) calcs(x), x_vals); | |
efficiency_vals = arrayfun(@(x, y) (y/(100*(x-1)/0.09)), x_vals, y_vals); | |
ax1 = subplot(2,1,1); % top subplot | |
ax2 = subplot(2,1,2); % bottom subplot | |
plot(ax1, x_vals, y_vals, '-'); | |
plot(ax2, x_vals, efficiency_vals, '--'); | |
xlabel(ax1, 'Rally Level') | |
ylabel(ax1, 'Total Gains') | |
title(ax1, 'Total Gains from Rally when receiving 1 EX at a time') | |
title(ax2, 'Return on Investment relative to EX spent on building up rally') | |
xlabel(ax2, 'Rally Level') | |
ylabel(ax2, 'RoI in % of EX spent') | |
function y = calcs(start) | |
current = start; | |
gain = 0; | |
fac = 1; | |
while (current > 1) | |
gain = gain + fac.*current; | |
current = current - fac.*0.005; | |
end | |
y = gain; | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment