fill the land in coasts.mat without M_Map
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Minh Phuong Truong
am 11 Feb. 2022
Kommentiert: Minh Phuong Truong
am 11 Feb. 2022
Hi all, I have coasts.mat file, and I would like to fill color to the land.
Thanks
2 Kommentare
Akzeptierte Antwort
KSSV
am 11 Feb. 2022
load('coasts.mat')
M = [Lon' Lat'] ;
idx = all(isnan(M),2);
idr = diff(find([1;diff(idx);1]));
D = mat2cell(M,idr(:),size(M,2));
set(gca,'color','b')
hold on
for i = 1:10%length(D)
patch(D{i}(:,1),D{i}(:,2),'r')
end
3 Kommentare
KSSV
am 11 Feb. 2022
I have fixed loop index only till 10, you have to increase it further. I have commented the line, if you see.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
