Octave programming - some advice for newbie

AI Thread Summary
To generate random integers in Octave, users can utilize a command similar to Matlab's `randint`. While the exact command may differ, the goal is to create a matrix of random integers within a specified range. For example, in Matlab, the command `randint(4, 5, 100)` generates a 4x5 matrix of random integers between 0 and 100. Users seeking to implement this in Octave should look for an equivalent function that provides similar functionality for generating random integers.
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.
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Back
Top