Numerical output of RC Circuit
You don't have integration in your code. A simple (not most precise) way to integrate is to use summation:
Vout = cumsum((1/RC) * Vin * dt);
cumsum is a cumulative summation function. Check its description on MATLAB site.