I am trying to run an octave script in Cmder. The issue I'm having is holding the figure window after executing the script. Here is the entire script I'm running:
N=10^6;
dt=1;
beta=1.4;
mi=1.3/365;
gamma = 1/7;
I(1)=10;
S(1)=N-I(1);
for n=2:600
I(n) = I(n-1)+dt*I(n-1)*(beta*(S(n-1)/N)-gamma-mi);
S(n) = S(n-1)+dt*(mi*N-S(n-1)*(I(n-1)*beta/N+mi));
endfor
x=S/N;
y=I/N;
R=1-x-y;
vreme=1:1:600;
figure 1, plot(vreme,y,"r","linewidth",1.5,
vreme,R,"g","linewidth",1.5,
vreme,x,"b","linewidth",1.5);
axis([0 200 0 1])
leg=legend("I","R","S")
set(leg,"fontsize",15);
grid on
hold on
After running the script in octave-gui or octave-cli, the figure stays. Running it in Cmder does not.
Here is an image of the figure showing when opening octave interactive mode:
I would like the figure to show calling the script (like in the first command) without going in interactive mode (with --persist lets say), How can I make the figure showing just calling octave C:\Users\Dusan\Desktop\SIR1.m ?
I tried using pause but that doesn't load the figure and if I try to interact with it, it crashes.