Select a columns of a Matrix using Selector in Simulink
18 次查看(过去 30 天)
显示 更早的评论
I am having the following simulink model, which contain a Matrix A [3×6] of doubles, and I would like have a selector that selectes the columns of the matrix. (For instance I have a constant which has a value of 2, and then I can select A(:,2))
I have tried with the selector in Simulink, but I coudn't fix it!
I appreciate any help, and Thanks in advanvced!
0 个评论
采纳的回答
Jon
2023-6-15
编辑:Jon
2023-6-15
I think this is what you are trying to do, in the example below I select the first and the third column from the 3x6 matrix :
2 个评论
Jon
2023-6-15
If I understand what you are asking, if you put a value of 2 into the constant block that connects to the Idx2 port of the selector you will select just column 2, that is A(:,2). Is this what you are asking?
Note the input to the Idx2 port could also be wired to a variable that changes dynamically as your simulation progresses
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Functions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!