rectangles

版本 1.1.0.0 (3.3 KB) 作者: Matthew Eicholtz
Draw multiple rectangles fast.
115.0 次下载
更新时间 2016/9/22

查看许可证

Have you ever needed to draw a bunch of rectangles on a figure? Did your code look like this:
for i=1:numberOfRectangles
rectangle('Position',blah blah blah...);
end
This code can become quite slow when the number of rectangles increases significantly. I wrote the RECTANGLES function to solve this problem by plotting multiple rectangles as a single patch.
The only required input is an Mx4 array of rectangle vectors [x,y,w,h] corresponding to M rectangles.
>> rectangles(pos);
See the function header for additional details and a list of optional parameters. Run the demo script if you want to view sample results fast without writing any code yourself.

引用格式

Matthew Eicholtz (2024). rectangles (https://www.mathworks.com/matlabcentral/fileexchange/59243-rectangles), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2016a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Surface and Mesh Plots 的更多信息
致谢

启发作品: rectangles

Community Treasure Hunt

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

Start Hunting!
版本 已发布 发行说明
1.1.0.0

Added str2rgb as helper function.

1.0.0.0

Updated summary.
Updated thumbnail.