Spliting a line segment into desired length segments (Matlab)

  • MATLAB
  • Thread starter mushi
  • Start date
  • #1
mushi
23
0
Hi Guys,

I don't know if I make sense but please try to help me.

I am working in Matlab. I have multiple line segments of different lengths with end point coordinates. I want to split each major segment into multiple minor segments in a way that all segments will have same length. 'linspace' can only control number of segments regardless of their lengths. For me, number of segments are not important, but their lenghts are important (must be equal). I want their coordinates like 'linespace' does. It is not necessary that the full length of all segments will be utilized.

For example:
I have Major segments of:
(1) 3KM (2) 5KM (3) 12KM (with their end points)

I want to get:
I want to divide each major segment into multiple minor segments (say 2.5 KM each) with their coordinates.

Any help will be greatly appreciated.

Mushi
 

Answers and Replies

  • #2
JesseC
250
2
What is a line segment? Can you give an example of your code?
 
  • #3
NemoReally
188
1
calculate n by dividing the major segment length by the minor length, then use linspace
or
use the colon operator ... 0:2.5:12
 

Suggested for: Spliting a line segment into desired length segments (Matlab)

Replies
1
Views
5K
Replies
1
Views
18K
Replies
1
Views
2K
  • Last Post
Replies
4
Views
4K
  • Last Post
Replies
4
Views
913
  • Last Post
Replies
0
Views
8K
  • Last Post
Replies
4
Views
2K
  • Last Post
Replies
1
Views
6K
  • Last Post
Replies
9
Views
2K
Replies
4
Views
6K
Top