Octave programming - some advice for newbie

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 7K views
Yukisan
Messages
1
Reaction score
0
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
 
Physics news on Phys.org
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:
>> 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.