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

Re: Howw to extract a vector from a matrix in simulink?

$
0
0
On Tuesday, April 24, 2012 at 6:11:27 PM UTC-5, loudro...@gmail.com wrote:
> On Saturday, April 4, 2009 5:39:01 PM UTC-5, Negar wrote:
> > 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
>
> 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.

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.

Viewing all articles
Browse latest Browse all 4

Trending Articles