Octave (free MATLAB alternative) - Command line arguments and user keyboard input

Опубликовано: 22 Май 2026
на канале: Multilingual Programming
203
like

Video Chapters (table of content with clickable links into a specific part of the video)
00:00 Introduction about the video content
00:42 Prerequisites (you should have some programming skills in at least some language)
01:06 Octave vs MATLAB
01:22 Command prompt (showing Octave version, creates directory, starts Visual Studio Code)
02:13 Creates an Octave file with a "Hello World" script
02:40 Executes "Hello World" with the function 'disp'
03:13 'printf' vs 'fprintf' (Octave / MATLAB)
03:35 MATLAB and 'printf' ?
04:55 Executes "Hello World" with the function 'fprintf'
05:08 Starts the implementation with code receiving arguments from the command line
07:05 Executes as a script with program arguments
07:11 Changes the file to become a function instead of a script
09:28 Executes as a function call with argument for the function and with the flag --eval
10:13 Starts the implementationen with code receiving input from the keyboard
11:05 Executes the updated script as a function call with the flag --eval
11:55 Executes the function call from within Octave's command console (with a matrix as argument)
12:08 Changes the function, from expecting a matrix as argument to instead use a 'cell array'
13:20 Executes the function from within Octave's command console (with a 'cell array' as argument)
13:50 Changes the file from function to script which can be called with the function 'source'
14:14 Executes the script with the function 'source' from within Octave's command console
14:35 Redefines the function 'argv' to provide arguments when executing the script with the function 'source'


Please note that you can choose to show english subtitles for the videos.

Currently (when this video was published) there are not many videos in the below playlists but please remember to subscribe to this channel if you think you are interested in future videos which will become added to the play lists.

Playlists for "Program arguments from command line and keyboard input" for different programming languages:
Playlist for the videos with english voice and english subtitles:
   • Program arguments from command line and ke...  
Playlist for the videos with swedish voice and swedish subtitles:
   • Program argument från kommandoraden och in...  

Octave playlist (english):
   • Octave (free MATLAB alternative) - Command...  
Octave playlist (swedish):
   • Octave (fritt MATLAB alternativ) - Program...  

GNU Octave
https://octave.org/
https://www.gnu.org/software/octave/
https://en.wikipedia.org/wiki/GNU_Octave

Function 'argv'
https://octave.org/doc/v7.1.0/Command...
https://octave.org/doc/v7.1.0/Passing...

Function 'input'
https://octave.org/doc/v7.1.0/Termina...

Function 'disp'
https://octave.org/doc/v7.1.0/Termina...

Function 'fprintf '
https://octave.org/doc/v7.1.0/Formatt...

Function 'length'
https://octave.org/doc/v7.1.0/Object-...

Function 'rows'
https://octave.org/doc/v7.1.0/Object-...

Function 'source'
https://octave.org/doc/v7.1.0/Script-...

'for loop' with 'endfor' (mentioned in the video at the time 09:43)
https://octave.org/doc/v7.1.0/The-for...

"Can end statement replace endfor statement in Octave?" (shown in the video at the time 09:56)
https://stackoverflow.com/questions/6...

Matrices
https://octave.org/doc/v7.1.0/Matrice...

Matrix index expression
https://octave.org/doc/v7.1.0/Index-E...

Cell arrays
https://octave.org/doc/v7.1.0/Cell-Ar...

Octave Command Line Options (for example --eval )
https://octave.org/doc/v7.1.0/Command...


MATLAB - Functions
https://se.mathworks.com/help/matlab/...