Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Octave programming - some advice for newbie

  1. Jan 14, 2009 #1
    Hi there - I am looking to get some help in programming with Octave. Trying to work out a random integer generator and well not really getting anywhere so far - I'm hoping someone can give an example or guide in terms of how I should go about doing it in Octave.

    Thanks
     
  2. jcsd
  3. Jan 14, 2009 #2
    I've never used Octave but, given that it's attempting to be a clone of Matlab, I'd guess that it's got a randint command somewhere. For instance, to produce a 4x5 matrix of random integers over the range (0, 100) in Matlab you'd issue the command

    Code (Text):

    >> randint(4, 5, 100)

    ans =

        12    27    15    80
        91    54    97    14
        63    95    95    42
         9    96    48    91
     
    Presumably Octave has something similar.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: Octave programming - some advice for newbie
  1. Octave: M-Files (Replies: 3)

Loading...