How to select 6 elements from 9 in matrix 3x3 using block "Selector" in Simulink?

6 ビュー (過去 30 日間)
How to select 6 elements from 9 in matrix 3x3 using block "Selector" in Simulink? I have a matrix like this: a11 a12 a13 a21 a22 a23 a31 a32 a33 and in Scope i have 9 lines. I want to select 6 elemets: a11 a12 a13 a22 a23 a33 in order to have 6 lines in Scope.

採用された回答

Martin Butcher
Martin Butcher 2015 年 6 月 19 日
Hi,
you can use the selector block, set the number of input dimensions to two, and set the indices as appropriate.
See example attached.
Martin

その他の回答 (2 件)

Martin Butcher
Martin Butcher 2015 年 6 月 19 日
File attached this time!
  1 件のコメント
Anastasiya Krivtsova
Anastasiya Krivtsova 2015 年 6 月 19 日
Thanks. But can i select a triangular matrix from matrix 3x3 using the "Selector"?

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


Martin Butcher
Martin Butcher 2015 年 6 月 19 日
I see I misread the details of your original question.
I don't think you can do this directly with a single selector block. You could use three selector blocks and mux the outputs, or you could reshape it from a 3x3 matrix to 9 element array and use a selector block for each element. I prefer the latter as it is tidier.
Example attached.
Enjoy.

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by