draw vertical lines at regular intervals in a rectangle in matlab
Show older comments
I need to draw vertical lines at regular intervals in a rectangular box. this is what i have used so far:
xmin=000;
xmax=70000;
ymin=0;
ymax=1000;
line1Val=900;
line2Val=600;
line3Val=300;
xlim([xmin xmax])
ylim([ymin ymax])
xl=get(gca,'XLim');
line(xl,[line1Val line1Val],'Color','y');
line(xl,[line2Val line2Val],'Color','y');
line(xl,[line3Val line3Val],'Color','y');
hold on ;
rectangle('Position',[120000,900,(280000-120000),37],'faceColor','k')
so the width of the rectangle is 160000 units i want to divide this into 4 , where the vertical line is of a different color(say red) and the height of the line is 37 units.
any ideas on how i can draw this without drawing 4 rectangles whose edges are red and are filled with black color.
1 Comment
Ramesh Bala
on 24 Oct 2018
I'm not pretty sure ,but this may help
https://de.mathworks.com/matlabcentral/answers/218445-how-can-i-divide-a-line-into-equal-parts-and-divide-them-into-small-circles-of-equal-radius
Answers (1)
madhan ravi
on 24 Oct 2018
0 votes
Categories
Find more on Image Arithmetic in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!