Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Matrix search
Replies: 3   Last Post: Jun 12, 2013 9:35 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Narayanan

Posts: 14
Registered: 6/10/13
Re: Matrix search
Posted: Jun 12, 2013 9:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Suppose in the same N x 4 matrix, in the first column if I want to start a search at a particular value run it till a particular value how to do it? If the first column elements are like 112 384 94 12 34 56 78 91 74 57 35 23 50 26 59 16 79 385 967 917. I want the search to start from a value less than 25 and run till a value less than 400. In this case it should start from 12 and end at 385. (This is an example matrix. Mine has more random numbers.) Thank You

dpb <none@non.net> wrote in message <kp9o7i$9iv$1@speranza.aioe.org>...
> On 6/12/2013 6:19 AM, Narayanan wrote:
> > How to do a logical operation wit a matrix column? I have a N x 4
> > matrix. If any value is greater than 2 or less than 8 in the first
> > column then i have to print "VALID" else "INVALID". I am able to search
> > the matrix with A(:,1) condition but unable to check the OR condition.

>
> >> v=randperm(8)
> v =
> 2 5 3 6 8 7 4 1

> >> s={'Y';'N'};
> >> v>2 & v<8

> ans =
> 0 1 1 1 0 1 1 0

> >> sprintf('%s ', s{(v>2 & v<8)+1})
> ans =
> Y N N N Y N N Y

> >>
>
> Salt to suit...
>
> --



Date Subject Author
6/12/13
Read Matrix search
Narayanan
6/12/13
Read Re: Matrix search
dpb
6/12/13
Read Re: Matrix search
Narayanan
6/12/13
Read Re: Matrix search
dpb

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.