this is not really a nonlinear problem. That's because dropping some parenthesis)
C2*sin(2*pi/24*(x-C3)) = -C2*[ sin(2*pi/24*C3)*cos(2*pi/24*x) +cos(2*pi/24*C3)*sin(2*pi/24*x) ]
Sine and cosine are linearly independent functions, so if you can do a linear fit
data = D2*cos(2*pi/24*x) + D3*sin(2*pi/24*x)
D2 = -C2*sin(2*pi/24*C3)
D3 = C2*cos(2*pi/24*C3)
C2 = sqrt(D2^2 + D3^2)
2*pi/24*C3 = atan2(-D2,D3)
so if you know C you know D and vice versa. Same for the other two sine functions as well, using D4,D5 and D6,D7.
If you set up a wind data matrix that is 24x31 (hours down, days across) x 8 for heights then you can fit the entire month in one go, and loop over heights. In the code below, C1 and D1 are the same.
D = zeros(7,31,8);
x = (0:23)';
M = [ones(size(x)) cos(2*pi/24*x) sin(2*pi/24*x)...
cos(2*pi/ 8*x) sin(2*pi/ 8*x)];
Wind = rand(24,31,8);
for k = 1:8
D(:,:,k) = M\Wind(:,:,k);
The result is a 7x31x8 matrix of coefficients.