matlab - Neat way of generating rectangle coordinates from two corner points? -
i'm plotting box in matlab 4 coordinates. there neater way generate these vectors writing them out explicitly?
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' );
in case, variables called lat_min
, ax_min
, means above lines won't fit 80 characters. , i'd that, since i'm going print code.
how using rectangle
:
pos = [ax_min, lat_min, ax_max - ax_min, lat_max - lat_min]; rectangle('position', pos, 'edgecolor', 'r')
Comments
Post a Comment