correlation coefficient prob...

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • siddharthkumarr
    New Member
    • Aug 2008
    • 2

    correlation coefficient prob...

    hello everybody...i m a newbie and struggling with a small assignment which involves
    1- creating a dynamic array for floating point numbers
    2- comparing adjacent numbers and finding the CORRELATION COEFFICIENT....


    can u tell me what functions to use so dat i can start of with?? i wud b rlyyyy grateful...than xxx
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    do you know PHP?





    Dan

    Comment

    • siddharthkumarr
      New Member
      • Aug 2008
      • 2

      #3
      i do know d basics but d prob is i dnt know how to create a dynamic array...1 dimensional dynamic array for entering float point numbers.....

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        Originally posted by siddharthkumarr
        i do know d basics but d prob is i dnt know how to create a dynamic array...1 dimensional dynamic array for entering float point numbers.....
        Start by reading a tutorial on PHP arrays ...

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Originally posted by siddharthkumarr
          i do know d basics but d prob is i dnt know how to create a dynamic array...1 dimensional dynamic array for entering float point numbers.....
          here's a code to create any array:

          [PHP]

          //first create the array:
          $myArr = array();

          //to add a value to the array (push on top/end)
          array_push($myA rr,"value_here" );

          // to traverse your array, you can use a for loop
          for($i = 0; isset($myArr[$i]); $i++)
          {
          echo "index $i contains " . $myArr[$i] . "<br />";
          }



          [/PHP]

          With PHP you can mix the any type of variable in the array: you can have an array that contains text, integers , or any number, or boolean value.

          Also you do not need to worry about the array size. that is automatically handled.

          for more info, refer to:http://php.net/array


          Good luck,





          Dan
          Last edited by Atli; Aug 20 '08, 01:50 PM. Reason: Removed the us3 from php.net. It's a lot faster for those of us that are not in the US this way ;)

          Comment

          • Atli
            Recognized Expert Expert
            • Nov 2006
            • 5062

            #6
            You shouldn't call array_push to add a single variable to an array.
            It is a lot faster to do it like so:
            [code=php]
            $array[] = $someVar;
            [/code]
            array_push should only be used when you need to add multiple elements to an array.
            [code=php]
            array_push($arr ay, $var1, $var2, $varN);
            [/code]

            Comment

            • Markus
              Recognized Expert Expert
              • Jun 2007
              • 6092

              #7
              Shouldn't that 'PLZ HELP..!!!' be removed?

              Comment

              • Atli
                Recognized Expert Expert
                • Nov 2006
                • 5062

                #8
                Originally posted by markusn00b
                Shouldn't that 'PLZ HELP..!!!' be removed?
                Good point. It should, and it has been.

                siddharthkumarr ,

                Please avoid putting phrazes like "plz help" in your thread titles. It makes it harder for the other members to spot problems they may be able to help with and it actually makes people less likely to read your thread.

                Take a look at the Posting Guidelines please. It's all explained there.

                MODERATOR

                Comment

                Working...