Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Howw to extract a vector from a matrix in simulink?

5,352 views
Skip to first unread message

Negar

unread,
Apr 4, 2009, 6:39:01 PM4/4/09
to
Hi,

I have a 2x2 matrix, [A]. Sometimes one column of this matrix is zero and some times both columns are non-zero. I want to extract a 2x1 vector from this matrix such that:
-If both columns of A are non-zero, extract the column with smaller value in the second row. For example if A=[6 2
3 10], then [6
3] is extracted.

-If one of the columns of A is zero, then the non-zero column is extracted. For example if A=[4 0
5 0], then [4
5] is extracted.
I need to implement this simulink. I've tried the minimum block (from signal processing blockset), submatrix block and variable selector block but still have not been able to get this right. The problem with submatrix block is that it does not accept variable indices. Any hint is much appreciated.

Negar

Phil Goddard

unread,
Apr 4, 2009, 11:25:06 PM4/4/09
to

loudro...@gmail.com

unread,
Apr 24, 2012, 7:11:27 PM4/24/12
to Negar
There is a 'Variable Selector' block in the DSP Systems Toolbox, you can pick either rows or columns and then tell it which row or column, or make it dynamic.

mika...@gmail.com

unread,
Jan 23, 2015, 9:21:05 AM1/23/15
to
Variable selector works, too bad they charge you to use the DSP toolbox as the only way to do something that should be a common practice.
0 new messages