by Nasser M. Abbasi
To be able to plot the solution, I directed the output of the program to a text file, then loaded the text file to Matlab and ran the simulation that way.
The program contains 3 files
To compile, I did
$ gnatmake -gnat05 -gnatwa main.adb gcc -c -gnat05 -gnatwa lax_wendroff_pkg.adb gnatbind -x main.ali gnatlink main.ali
To run, I did
./main > result.txt
To see the simulation, then from Matlab, I run the following script
A=load('result.txt','-ascii');
B=reshape(A,100,100);
for i=1:size(B,2)
plot(B(:,i))
ylim([-1 1]);
drawnow();
pause(0.01);
end