I'm solving a problem in numerical analysis, page 9 of this text (soundwaves under water) and I think that I'm getting the correct result but I'm not sure if I programmed my derivate correct. My matlab code is for the system is:
function dZ=sys(t,Z,w)
z = 2000;
c = 4800 - 20.2090 + (17.3368)*z/1000+ (272.9057)*exp(z*0.7528/1000);
c2=@(z)4800 - 20.2090 + (17.3368)*z/1000+ (272.9057)*exp(z*0.7528/1000); % c(z)
q=c2(2000);
dZ=zeros(2,1); % a column vector
dZ(1)=Z(2);
dZ(2)=-(q/cosd(w))^2*(((0.7528/1000)*272.9057*exp(Z(1)*0.7528/1000)) + 17.3368/1000)/...
(4800 - 20.2090 + (17.3368)*Z(1)/1000+ (272.9057)*exp(Z(1)*0.7528/1000))^3;
end
Then I can plot it like this which seems not right and I don't know what more I can change to improve the result.

The other codes I use are:
x=0:1:6076*25;
w=7.8;
[X,Z] = ode45(@(t,Z) sys(t,Z,w),x,[2000 tand(7.8)]);
plot(X,Z(:,1),'r') %Z(:,1) is z(x) and Z(:,2) is z'(x).
You missed a negative sign in the exponential (and it was bad code).