Results 1 to 2 of 2

Math Help - [SOLVED] While loop, array as a condition. Error

  1. #1
    Newbie
    Joined
    Dec 2008
    Posts
    5

    [SOLVED] While loop, array as a condition. Error

    first off here is the error,

    ??? Function 'gt' is not defined for values of class 'cell'.

    Error in ==> insertionsort at 7
    while (j > 0) && (A(j) > key)

    It happens when I try to set any kind of array value as a condition for a loop.

    Code:
    while (j > 0) && (A(j) > key)
    end
    Of course I have full code but that is where the error lies. If I was the say output A(1) it will output just fine so my array is ok.

    gt is the greater than function in matlab, I am assuming it does not like arrays? If so how can I get around this? documentation is no help.
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Newbie
    Joined
    Dec 2008
    Posts
    5
    syntax issue, needed to use {} instead of ()
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. [SOLVED] Area of one loop of a lemniscate
    Posted in the Calculus Forum
    Replies: 1
    Last Post: May 5th 2010, 10:44 PM
  2. [SOLVED] Confusing first order condition
    Posted in the Calculus Forum
    Replies: 1
    Last Post: March 9th 2010, 11:42 PM
  3. [SOLVED] transversality condition
    Posted in the Differential Equations Forum
    Replies: 1
    Last Post: January 13th 2010, 09:59 AM
  4. [SOLVED] Prove differentiability from Lipschitz condition
    Posted in the Differential Geometry Forum
    Replies: 2
    Last Post: April 8th 2009, 12:12 PM
  5. [SOLVED] Finding the area inside a loop?
    Posted in the Calculus Forum
    Replies: 2
    Last Post: November 20th 2008, 04:08 AM

Search Tags


/mathhelpforum @mathhelpforum