Originally Posted by dkv23
By funky i mean the values alternate between a positive and negative values, I am aware of the clear and clc part. The number of intervals could be as small as five and as large as 10k all it does is generate a better approximation. The issue with the alternating values is that the graphs that result when plotted either converge on a value or form a hyperbola, they should however form a some thing similiar to an expential decay. I am attaching a link to a similiar problem that only incorporates the second boundry condition. the example is halfway down in the link. https://profjrwhite.com/matlab_course...x/fd_intro.pdf
Alright, I think I see what your talking about, I just ran a data set and exported the x and y vectors into excel and plotted them and got the following...
and for further help, writing any kind of code always requires the proper material to assist in programming...