Check that point doesnt lay on line in Simulink block diagram

1 回表示 (過去 30 日間)
Sergey Kasyanov
Sergey Kasyanov 2020 年 11 月 22 日
コメント済み: Sergey Kasyanov 2021 年 3 月 4 日
Hello!
I want to connect some block programatically. The simplest way for that is to add_line by points but when i add line by that way i encounter problem when points lay on existing line. In that situation two different lines are linked. Is there any way to check point to laying on existing line?
  4 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 11 月 22 日
If you need to connect from a to b and a to c, can't you run add_line(a,b) and add_line(a,c) to achieve it?
Sergey Kasyanov
Sergey Kasyanov 2020 年 11 月 23 日
It works! Thanks!
I sure that I have try that way some times and that doesnt work because one of port has a connection.
Write answer please. I will approve it.

サインインしてコメントする。

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 11 月 23 日
Checking whether a point lays on any existing line will be very difficult. The answer to the OP's question seems to be utilizing add_line() in a different way. Rather than specifying multiple points in one add_line() to achieve connecting multiple ports, calling add_line(SourcePort, DestinationPort) multiple times seems to meet the need.
  5 件のコメント
Fangjun Jiang
Fangjun Jiang 2021 年 3 月 4 日
Could it be possible that those places only allow one connection?
Sergey Kasyanov
Sergey Kasyanov 2021 年 3 月 4 日
No, because there are some connections to it already exist. Moreover I can connect another port to it.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by