Octave programming - some advice for newbie

Click For Summary
SUMMARY

The discussion focuses on generating random integers using Octave, a programming language designed to be compatible with Matlab. Users suggest that Octave likely includes a command similar to Matlab's 'randint'. An example provided demonstrates how to create a 4x5 matrix of random integers ranging from 0 to 100 using the 'randint' command in Matlab. This indicates that Octave users can expect similar functionality for random integer generation.

PREREQUISITES
  • Basic understanding of programming concepts
  • Familiarity with Octave syntax
  • Knowledge of matrix operations
  • Experience with random number generation techniques
NEXT STEPS
  • Explore the Octave documentation for random number generation functions
  • Learn about matrix manipulation in Octave
  • Investigate the differences between Octave and Matlab commands
  • Practice writing Octave scripts for generating random data
USEFUL FOR

New programmers, students learning numerical computing, and anyone transitioning from Matlab to Octave who seeks to understand random integer generation.

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
 
Technology 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.
 

Similar threads

  • · Replies 17 ·
Replies
17
Views
5K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
6K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 22 ·
Replies
22
Views
12K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
19
Views
4K
  • · Replies 58 ·
2
Replies
58
Views
5K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 15 ·
Replies
15
Views
4K