Draw a rectangle

This is a function to draw a rectangle given the center, width and height, and the rotation angle.
1.3K 次下载
更新 2011/11/15

查看许可证

H = DRAWRECTANGLE(PARAM,STYLE)
This function draws a rectangle with the given parameters:
- inputs:
param................... 1x5 array
- param = [a, b, w, h, theta]
- (a,b): the center of the rectangle
- (w,h): width and height of the rectangle > 0
- theta: the rotation angle of the rectangle
style................... string
- plot style string
- output:
h....................... plot handler

Usage Examples,

DrawRectangle([0 0 1 1 0]);
DrawRectangle([-1,2,3,5,3.1415/6],'r-');
h = DrawRectangle([0,1,2,4,3.1415/3],'--');

Rasoul Mojtahedzadeh (mojtahedzadeh _a_ gmail com)
Version 1.00
November, 2011

引用格式

Rasoul Mojtahedzadeh (2026). Draw a rectangle (https://ww2.mathworks.cn/matlabcentral/fileexchange/33767-draw-a-rectangle), MATLAB Central File Exchange. 检索时间: .

MATLAB 版本兼容性
创建方式 R2011a
兼容任何版本
平台兼容性
Windows macOS Linux
类别
Help CenterMATLAB Answers 中查找有关 Polar Plots 的更多信息
版本 已发布 发行说明
1.1.0.0

- The problem with calculating the center of the rectangle has been solved.

1.0.0.0