create point betweem two points
2 views (last 30 days)
Show older comments
Majid Al-Sirafi
on 15 Jul 2012
Edited: Walter Roberson
on 28 Jan 2018
Hi every one
I have two points, for example
(2,5)-(10,15)... how can I create a new point between them???
thanks a loot
majid
0 Comments
Accepted Answer
Walter Roberson
on 15 Jul 2012
NumberNewPoints = 3;
xvals = linspace(2, 10, NumberNewPoints+2);
yvals = linspace(5, 15, NumberNewPoints+2);
pts = [xvals(:), yvals(:)];
Now the points are the rows.
11 Comments
Walter Roberson
on 16 Jul 2012
Edited: Walter Roberson
on 28 Jan 2018
pts(1,:) %x,y for starting point
pts(2,:) %x,y for intermediate point
pts(3,:) %x,y for final point
More Answers (1)
See Also
Categories
Find more on Fixed-Point Designer in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!