Quantcast
Channel: MATLAB Central Newsreader - Howw to extract a vector from a matrix in simulink?
Viewing all articles
Browse latest Browse all 4

Howw to extract a vector from a matrix in simulink?

$
0
0
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

Viewing all articles
Browse latest Browse all 4

Trending Articles