How to draw a rectangle in matlab with only his center ?
25 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Image Analyst
le 14 Déc 2017
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 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!