Hi Muskula,
To accomplish your task,load the sea surface temperature data from the provided SST_1year.mat file.
load('SST_1year.mat');
Plot the sea surface temperature data with the longitude range from 0 to 360.
figure;
imagesc(lon, lat, sst_data);
colorbar;
xlabel('Longitude');
ylabel('Latitude');
title('Sea Surface Temperature Plot');
Then, highlight the coastline by overlaying a coastline map on your existing plot by using the coast function from the Mapping Toolbox if available.
% Check if Mapping Toolbox is available
if license('test', 'map_toolbox')
hold on;
coast = load('coast.mat');
plot(coast.long, coast.lat, 'k'); % Plot coastline in black color
hold off;
else
disp('Mapping Toolbox is required to plot the coastline.');
end
To define a global coastline shapefile for a pcolor plot in Matlab with a data range from 0 to 360, you can adjust the longitude values of the coastline data. You need to shift the coastline data points that fall in the range of 180 to 360 to negative values by subtracting 360 from them. This adjustment aligns the coastline data with the desired longitude range. Here is a simple example to illustrate this adjustment:
% Load coastline data
load coast
% Adjust coastline data for range 0 to 360
coast(coast(:, 1) >= 180, 1) = coast(coast(:, 1) >= 180, 1) - 360;
% Plot pcolor with adjusted coastline
figure
pcolor(X, Y, C)
hold on
plot(coast(:, 1), coast(:, 2), 'k')
Hope this answers your questions. Good luck