how to set port using loop indexing instead of defining every node pair explicitly.

2 ビュー (過去 30 日間)
I have created a 3 port network in matlab. What I want to achieve is to set port of the network using setports function but I dont want to explicitly write the node pair like this:
setports(ckt,[6 0] ,[3 0] ,[2 0])
I have node array like this
port_node =
6 0
3 0
2 0
So what I want is to set ports using port_node indexing instead of explicitly assign its value. Would you please let me know how to do that?

採用された回答

Fangjun Jiang
Fangjun Jiang 2022 年 7 月 13 日
編集済み: Fangjun Jiang 2022 年 7 月 13 日
setports(ckt,port_node(1,:),port_node(2,:),port_node(3,:))
or
b=mat2cell(port_node,ones(size(port_node,1),1),size(port_node,2))
setports(ckt,b{:})
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2022 年 7 月 13 日
See the second approach
Aakriti Srivastava
Aakriti Srivastava 2022 年 7 月 13 日
hey yaah second option works well thanks

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatched Filter and Ambiguity Function についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by