How to divide many lines ?

조회 수: 3 (최근 30일)
Bronislav Bonczek
Bronislav Bonczek 2023년 1월 30일
편집: Matt J 2023년 1월 30일
Hello, need little help with one problem.
I have code which making a construction and I need to divide every line.
clc
clear
nodes=[0 0 %X-coord, Y-coord
0 -10
10 -12
10 0
20 -10
20 0];
Nnodes = size(nodes,1);
lines = [1 2 %1.node, 2.node
2 3
3 4
3 5
5 6 ];
Nlines = size(Nlines,1);
and then of course I also need the correct matrices with all nodes and lines
hope, you will help me.
Thanks

답변 (1개)

Jiri Hajek
Jiri Hajek 2023년 1월 30일
Hi, since your oibjective is to split all existing lines, its sufficient to:
  1. Get coordinates of the midpoints in all existing lines.
  2. Add the midpoints to your original points and you have the new points array
  3. Create two lines from each of the original lines, using the new midpoints.

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

태그

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by