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.
     
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook




Loading...
Similar Threads for Octave programming advice Date
C/++/# How to use C++ in studying calculus Apr 3, 2018
I need help decrypting this Mar 24, 2018
Programming succesive trapezoidal integrator Mar 16, 2018
What should be the rules to write excellent code? Mar 12, 2018
Octave: M-Files Aug 2, 2008