% AIS自动船舶系统显示
% 生成虚拟船舶数据
num_ships = 5;
ship_data = rand(num_ships, 3); % 每行数据格式:[经度 纬度 航向]
% 创建地图
figure;
ax = worldmap(‘World’);
setm(ax, ‘FFaceColor’, [0.8 0.9 1]); % 设置海洋颜色
% 显示船舶
for i = 1:num_ships
lat = ship_data(i, 2);
lon = ship_data(i, 1);
heading = ship_data(i, 3);
geoshow(lat, lon, 'DisplayType', 'point', 'Marker', 'o', 'MarkerEdgeColor', 'r', 'MarkerFaceColor', 'r', 'MarkerSize', 10);
quiverm(lat, lon, sind(heading), cosd(heading), 'r'); % 显示航向
end
% 标题
title(‘AIS船舶显示’);