I've written MATLAB code for a one dimensional advection-dispersion for a conservative contaminant as follows.

```
% Analysis of 1D conservative contaminant migration through porous media.
% For t=25 days.

% Parameters:
dt = 1;
dx = 10;

% Coeffecients
m = (dt/dx^2)- (dt/dx);
n = -2*dt/(dx^2);
p = dt/(dx^2)+ dt/dx;

%Initialization
for i = 1:11
    c(i)= 0.0;
    h(i)= 0.0;
end

%Initial condition
c(6)= 500.0;

%Boundary condition
for i=1:11
    c(1)=0.0;
    c(11)= 0.0;
    h(1)= 0.0;
    h(11)= 0.0;
end
for k=1:25
    for i=2:10
        h(i)= c(i+1)*m + c(i)*n +c(i-1)*p;
    end
    for i=1:11
        c(i)=h(i);
    end
end

% Writing the results to file newfile.txt
fid= fopen('newfile.txt', 'wt');
fprintf(fid,%3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f
%3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f %3.3f\n,h);
fclose (fid);
contour(c);

```

But I am stuck at the [fprintf](http://www.mathworks.se/help/techdoc/ref/serial.fprintf.html) command syntax. Upon executing it, it shows that some parenthesis is missing.