Results 1 to 3 of 3

Thread: Arrays, indices problem

  1. #1
    Dec 2009

    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
    Dec 2009
    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
    Dec 2008
    South Coast of England
    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.

    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: Mar 7th 2012, 03:05 AM
  2. Using imagesc to visualize arrays in Octave
    Posted in the Math Software Forum
    Replies: 0
    Last Post: Sep 13th 2011, 10:54 PM
  3. Big Fractions and Big Arrays
    Posted in the LaTeX Help Forum
    Replies: 3
    Last Post: May 12th 2011, 03:13 AM
  4. Mapping arrays to use negative indexes
    Posted in the Math Software Forum
    Replies: 5
    Last Post: Jun 14th 2009, 12:05 PM
  5. A puzzle and orthogonal arrays
    Posted in the Discrete Math Forum
    Replies: 7
    Last Post: Apr 27th 2008, 12:42 AM

Search Tags

/mathhelpforum @mathhelpforum