多普勒雷达系统仿真的一部分,但不晓得是实现什么功能的
如果有人能给我讲解一下就太好了
% %----------find relative location of cities
% city = xlsread('city.xlsx');
% z = 1;
% for x = 1:286
% for y = 1:286
% dlat = city(y,3) - city(x,3);
% dlon = city(y,4) - city(x,4);
% if(x == y)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 0;
% z = z + 1;
% continue;
% else
% if(dlat >= 0 && dlon > 0) % 1
% tan = dlat/dlon;
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 5;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 4;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 3;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 2;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% end
% if(dlat >= 0 && dlon < 0) % 4
% tan = dlat/(-dlon);
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 13;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 14;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 15;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 16;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% end
% if(dlat <= 0 && dlon > 0) % 2
% tan = (-dlat)/dlon;
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 5;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 6;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 7;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 8;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% if(dlat <= 0 && dlon < 0) % 3
% tan = (-dlat)/(-dlon);
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 13;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 12;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 11;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 10;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% if(dlon == 0)
% if(dlat > 0)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% if(dlat < 0)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% end
% end
% end
% -----------constructing matrix
city_lo = load('city_location.txt');
year2011 = load('years/2011.txt');
for month = 1:12
for x = 1: 28075
for y = 1: 81796
if(city_lo(y,2) == year2011(x,1) && city_lo(y,3) == year2011(x,4) && year2011(x,3) == month)
city_lo(y,(month+3)) = year2011(x,5);
end
end
end
end
如果有人能给我讲解一下就太好了
% %----------find relative location of cities
% city = xlsread('city.xlsx');
% z = 1;
% for x = 1:286
% for y = 1:286
% dlat = city(y,3) - city(x,3);
% dlon = city(y,4) - city(x,4);
% if(x == y)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 0;
% z = z + 1;
% continue;
% else
% if(dlat >= 0 && dlon > 0) % 1
% tan = dlat/dlon;
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 5;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 4;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 3;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 2;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% end
% if(dlat >= 0 && dlon < 0) % 4
% tan = dlat/(-dlon);
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 13;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 14;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 15;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 16;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% end
% if(dlat <= 0 && dlon > 0) % 2
% tan = (-dlat)/dlon;
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 5;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 6;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 7;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 8;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% if(dlat <= 0 && dlon < 0) % 3
% tan = (-dlat)/(-dlon);
% if(tan < 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 13;
% z = z + 1;
% continue;
% end
% if(tan < 0.66817863 && tan >= 0.19891236)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 12;
% z = z + 1;
% continue;
% end
% if(tan >= 0.66817863 && tan < 1.49660576)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 11;
% z = z + 1;
% continue;
% end
% if(tan >= 1.49660576 && tan < 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 10;
% z = z + 1;
% continue;
% end
% if(tan >= 5.02733949)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% if(dlon == 0)
% if(dlat > 0)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 1;
% z = z + 1;
% continue;
% end
% if(dlat < 0)
% results(z,1) = city(x,1);
% results(z,2) = city(y,1);
% results(z,3) = 9;
% z = z + 1;
% continue;
% end
% end
% end
% end
% end
% -----------constructing matrix
city_lo = load('city_location.txt');
year2011 = load('years/2011.txt');
for month = 1:12
for x = 1: 28075
for y = 1: 81796
if(city_lo(y,2) == year2011(x,1) && city_lo(y,3) == year2011(x,4) && year2011(x,3) == month)
city_lo(y,(month+3)) = year2011(x,5);
end
end
end
end