Frequency modulation in MATLAB
The difference is the expected input. The cosd function expects the input to be expressed in degrees, and the cos function expects the input to be in radians. So you have cosd(theta)==cos(deg2rad(theta)). This is just from the MATLAB documentation page.

Are you using these correctly? For example, you do cosd(2*pi*F*t). So we have $\frac{2\pi \text{ radians}}{\text{cycle}}.\frac{F \text{ cycles}}{\text{second}}.[\text{seconds}]=2\pi F \text{ radians}$, as the input. You should be using cos not cosd because your input is expressed in radians.

BTW, I do not check the correctness of the actual code. That is on you.