geoplotで2点間の線分をfor文を用いずに複数プロットする方法
8 ビュー (過去 30 日間)
古いコメントを表示
geoplotで2点間の線分をfor文を用いずに複数プロットする方法はありますか?
plotでは複数列の行列を入力することで以下のような出力を、for文無しで得られます。
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/347259/image.png)
これをgeoplotでfor文を用いずに実現するには、geoplotのドキュメンテーションにあるように(以下)、変数を複数用意するしかありませんか?
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/347262/image.png)
for文を用いると動作が遅いので、その点を解消したいです。
0 件のコメント
回答 (1 件)
Ryuhei Funada
2020 年 8 月 20 日
下記のようなセル配列を作成して、{:}を使って入力します
latlonCl = {[35.6732 35.7232] [139.7313 139.7813] "g-*" [ 35.7732 35.8232] [ 139.8313 139.8813] "r-*"};
geoplot(latlonCl{:})
例2:parent で指定された Figureを利用したい場合
f = figure;
gx = geoaxes(f);
latlonCl = {gx [35.6732 35.7232] [139.7313 139.7813] "g-*" [ 35.7732 35.8232] [ 139.8313 139.8813] "r-*"};
geoplot(latlonCl{:})
gx.Basemap = "openstreetmap";
ご検討くださいませ。
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!