I was wondering if you could help me with a question. I have to edit a MATLAB file ForwardEuler_while.m to add a couple of tasks (Refer to image). My code right now, I think I edited it to work in the case for only one delta_t. However, I want to make some array so that I can plot the Forward Euler solutions for the four different values of delta t and the exact solution on one plot. I also want to be able to get the L1 error for each of the delta_t's and plot them. Right now, the code only does one delta_t and so there is only one L1 error value. I can make a seperate program using the data by running this program over and over, but I want to make it all in one program. Can you help me?
What I tried doing: My idea was to try to make an array (initialized as zeroes(n_max,1)) and then make the for loop so that the unew becomes unew(i+1) for delta_t(i+1), but at the end, I run into this problem with storing a number into a matrix and an array as well for the t_soln(n) and u_soln(n) as well.