how do i plot a rectangle havng cetain dimensions and inside it even number of parametric cordinates such dat the centres of all cordinates and centre of rectangle coincide?

i have to define a plan geometry in which my parametric input will be numb of columns..i wish to put columns in such a way dat dey are symetrically placed inside the rectangle..

 채택된 답변

I don't understand the question. Please give a numerical example. Maybe you can define the midpoint
xMid = (xLeft + xRight) / 2;
Then calculate other x based on distances from that
% Set up.
numberOfColumns = 4
xLeft = 1;
xRight = 11;
spacing = 0.2;
% Do it:
xMid = (xLeft + xRight) / 2
incr = 1 : numberOfColumns;
xRight = xMid - spacing * fliplr(incr)
xLefts = xMid + spacing * incr

댓글 수: 3

Thnx fr answering.. But I have to generate a Top view(plan) Of Rectangular building such that first i enter the dimensions of building which defines length and width of building...then i have to enter no. of columns by the user such that the columns will be distributed symmetrically in the plan ..whether the number of columns be 4,6,8,10..and so on (even number only)..This will make sure that the centre of plan and the centre of distributed columns coincide.,,And i have to plot it also to see the resulting configuration..
And my code doesn't do that? It finds the midpoint and makes several pairs of columns symmetrically on either side of the midline column. If that's not what you want then attach a diagram.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

질문:

2014년 7월 29일

댓글:

2015년 2월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by