[英]Generating all points of grid from given vectors of vertical and horizontal coordinates - MATLAB
[英]Neat way of generating rectangle coordinates from two corner points?
我正在從四個坐標在Matlab中繪制一個框。 有沒有比明確地寫出它們更整潔的方法來生成這些矢量了?
plot( ...
[x_min x_max; x_min x_max; x_min x_min; x_max x_max], ...
[y_min y_min; y_max y_max; y_min y_max; y_min y_max], ...
'-r' );
在我的情況下,這些變量稱為lat_min
和ax_min
,這意味着以上各行不能容納80個字符。 我真的很喜歡,因為我要打印代碼。
如何使用rectangle
:
pos = [ax_min, lat_min, ax_max - ax_min, lat_max - lat_min];
rectangle('Position', pos, 'EdgeColor', 'r')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.