plot a vessel in matlab

To plot a vessel in MATLAB, you can use the "plot" function with longitude and latitude values. Here is an example code to plot a vessel's position on a map:

main.m
% Define vessel's position
lat = 51.5074; % Vessel's latitude
lon = -0.1278; % Vessel's longitude

% Load a map image
worldmap('world');
load coastlines;
plotm(coastlat, coastlon);

% Plot vessel's position
plotm(lat,lon,'Marker','o','MarkerSize',10,'MarkerFaceColor','r');
274 chars
12 lines

This code will load a map of the world and plot the vessel's position with a red dot. You can modify the vessel's position by changing the lat and lon variables. This code can be useful for navigation and tracking applications.

gistlibby LogSnag