Time for action – making your first script

  1. Start the Octave interactive environment and open the editor:
    octave:1> edit
  2. Write the following commands in the editor, but leave out the hash marks (#) and the code line numbers to the right. They are used only for reference:
    Code Listing 4.1
    A = rand(3,5);          					#1
    								#2
    min(min(A))							#3

    Tip

    Downloading the example code

    You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.

  3. Save the file as script41.m (notice the extension .m) under the current directory or anywhere in the Octave search path directory.
  4. Now executing ...

Get GNU Octave now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.