Results 1 to 3 of 3

Math Help - Arrays, indices problem

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    2

    Arrays, indices problem

    OK, first of all I would like to say hello to everyone since this is my first post here, didn't know that this forum exists, nice to be here

    Here's the thing...

    I have to arrays: time and voltage, both of them containing data
    the problem is that I am looping through time and fetching the appropriate value of voltage like this:
    - first getting the index of the time value in a time array
    - and then getting the voltage value from a voltage array by the index

    The problem is the following, some particular value of time exists in the array but 'find' method doesn't return the right result, rather it returns 1x0 matrix, so it returns null...

    What and where can be the problem...Even when I type :
    index = find (time_array == 1.2345) it returns 1x0 matrix
    and the value of 1.2345 exists in the matrix!!

    Please help me cause I've tried debugging it but was unfortunate
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Dec 2009
    Posts
    2
    Is it possible that no one knows the solution to my problem?

    Let me simplify it:

    time = [ 1.1 1.2 1.3 1.4 1.5]
    voltage = [2 4 5 6 7]

    if I type:
    index = (time=1.1)
    which should return 1

    it return me:
    Empty matrix 1 by 0

    what could be the problem? for some numbers it works but for some it does not! is there any other way to fetch the index of some value in a matrix besides the "find" method.

    please help and that u in advance
    Follow Math Help Forum on Facebook and Google+

  3. #3
    MHF Contributor
    Grandad's Avatar
    Joined
    Dec 2008
    From
    South Coast of England
    Posts
    2,570
    Thanks
    1
    Hello rebellion

    Welcome to Math Help Forum!

    I presume you are referring to a programming problem here. What language are you using? Can you show us the code that you've tried?

    Perhaps someone here may be able to help if you could give us some more details.

    Grandad
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Comparing two arrays of data
    Posted in the Statistics Forum
    Replies: 0
    Last Post: March 7th 2012, 02:05 AM
  2. Using imagesc to visualize arrays in Octave
    Posted in the Math Software Forum
    Replies: 0
    Last Post: September 13th 2011, 09:54 PM
  3. Big Fractions and Big Arrays
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: May 12th 2011, 02:13 AM
  4. Mapping arrays to use negative indexes
    Posted in the Math Software Forum
    Replies: 5
    Last Post: June 14th 2009, 11:05 AM
  5. A puzzle and orthogonal arrays
    Posted in the Discrete Math Forum
    Replies: 7
    Last Post: April 26th 2008, 11:42 PM

Search Tags


/mathhelpforum @mathhelpforum