Я должен использовать метод Эйлера, чтобы найти зональное поле ветра для всех широт (-90S до 90N) и высот (от 0 до 22 км) на земле
%Wind speed = 0 at surface
a = -12;
b_1 = 40;
x = -90:1:90; %latitude
y = 0:1:22; %altitude
z_r = 12;
[X, Y] = meshgrid(x, y);
%dy_dx = (y_2 - y_1)/(x_2 - x_1)
T = a + (b_1*(1-Y/z_r)).(3./2(2./3 + (sin(Xpi/180)).^2).(cos(X*pi/180)).^3);
contourf(X,Y,T,'ShowText','on')
colorbar
title("Temperature field")
xlabel("Latitude (degrees)")
ylabel("Altitude (km)")
%all code works above this line as it should. You can plot this and you will see what is be happening in this simple model.
%gravity in km/s
g = 0.0981
%f = coriolis force
f = (1.458*10^(-4))sin(Xpi/180);
%here I'm trying to use eulers method to find the zonal wind field everywhere on earth
for i = 1:22
for j = 1:180
i(i,j) = 0
end
end
for i = 1:22
for j = 1:180
dtdy(i, j+1) = (T(i, j+1) - T(i, j))./(Y(i, j+1) - Y(i, j))
u(i+1, j) = u(i, j) - ((g./(f*T(i, j))).dtdy(i, j+1)*(X(i+1, j) - X(i, j)))./111.21
end
end
% Я получаю сообщение об ошибкеразмеры матрицы должны совпадать, но я не очень хорошо разбираюсь в matlab, поэтому не знаю почему.