fill the land in coasts.mat without M_Map

7 ビュー (過去 30 日間)
Minh Phuong Truong
Minh Phuong Truong 2022 年 2 月 11 日
コメント済み: Minh Phuong Truong 2022 年 2 月 11 日
Hi all, I have coasts.mat file, and I would like to fill color to the land.
Thanks
  2 件のコメント
KSSV
KSSV 2022 年 2 月 11 日
Attach your data.
Minh Phuong Truong
Minh Phuong Truong 2022 年 2 月 11 日
@KSSV I attached, can you take a look, thanks

サインインしてコメントする。

採用された回答

KSSV
KSSV 2022 年 2 月 11 日
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 件のコメント
KSSV
KSSV 2022 年 2 月 11 日
I have fixed loop index only till 10, you have to increase it further. I have commented the line, if you see.
Minh Phuong Truong
Minh Phuong Truong 2022 年 2 月 11 日
thank you, I have increse the loop to 10000, most of the islands have drawn

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File Exchange2-D and 3-D Plots についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by