2 Replies - 654 Views - Last Post: 12 July 2010 - 04:29 PM Rate Topic: -----

#1 neosam  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 04-July 10

Matlab help

Posted 05 July 2010 - 04:44 PM

Hello all,
I know this may be a wrong forum, but considering most people who know C would be aware of Matlab as well. I am working on Matlab and need some help. How can I search for a single element from a nx2 matrix? for example:

if A = 12 0
15 1
17 0
19 0
20 1
then how can I find out whether the value of '20' is '1' or '0' ? Is there another way of doing this?
I'm just using this as a flag and cant seem to figure it out.

Thank you.

Is This A Good Question/Topic? 0
  • +

Replies To: Matlab help

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6063
  • View blog
  • Posts: 23,515
  • Joined: 23-August 08

Re: Matlab help

Posted 05 July 2010 - 04:48 PM

Moved to Other Languages.
Was This Post Helpful? 0
  • +
  • -

#3 mufasa  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 44
  • Joined: 12-February 10

Re: Matlab help

Posted 12 July 2010 - 04:29 PM

are you assuming that you would know where the value of 20 is in the matrix first or that you would also have to find where 20 is in the matrix?

a simple loop would be easy enough if you have to find the 20 in the matrix and then use either a vector or a [1,2] matrix to store the row and column where the number is stored. after you have that you can just assign the value in the second column that you want to another variable that you can access later.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1