Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can we get user inputs from the keyboard in GNU Octave?

Tags:

octave

Is there a command like 'scanf' in GNU Octave to read the user inputs from the keyboard?

like image 953
athira Avatar asked Feb 03 '11 05:02

athira


Video Answer


1 Answers

Yes, the function is called input. A simple example:

octave-3.2.4:3> x = input("Enter a number: ")
Enter a number: 25
x =  25

See the documentation for details, like overriding the default parsing behavior.

like image 190
mtrw Avatar answered Jan 03 '23 02:01

mtrw