How to draw a rectangle in matlab with only his center ?
25 ビュー (過去 30 日間)
古いコメントを表示
I would like to draw a rectangle with only one informatiom which is his center . I have the coordinates X and Y of fis Center and like to draw a rectangle with specific dimesions . I would like to know if theres a function which do it
0 件のコメント
回答 (1 件)
Image Analyst
2017 年 12 月 14 日
The rectangle function.
width = 100; % whatever
height = 50; % whatever...
xCenter = 400; % Wherever...
yCenter = 800; % Wherever...
xLeft = xCenter - width/2;
yBottom = yCenter - height/2;
rectangle('Position', [xLeft, yBottom, width, height], 'EdgeColor', 'b', 'FaceColor', 'r', 'LineWidth', 4);
xlim([340, 460]);
ylim([740, 860]);
grid on;
0 件のコメント
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!