i got it hehe.. finally, the problem is i just compute my diskx function onece when i should compute it for each time step, and i notice that i don't really need the rhs function so i erase it and put my diskx directly inside my ode45 or 23 bracket and it works perfectly.
that is correct, but this is just the first step from several steps that i want to do. Later on i want to define c as a function of k, which as we know only exists in Fourier domain this is why i try to solve it through Fourier doamain . And this kind of relation is called the dispersion...
guys please help me, I'm trying to solve a simple moving PDE equation in matlab.
The equation I'm trying to solve is
dq(x,t)/dt=-c*dq(x,t)/dx
with initial condition for example q(x,0)=exp(-(x-5)^2)
c is a constant. What i want to do is to first discritize the initial condition with...