Book contents
- Frontmatter
- Contents
- Chapter 1 Introduction
- Chapter 2 Octave programming
- Chapter 3 Installing and running the Dev-C++ programming environment
- Chapter 4 Introduction to computer and software architecture
- Chapter 5 Fundamental concepts
- Chapter 6 Procedural programming basics
- Chapter 7 An introduction to object-oriented analysis
- Chapter 8 C++ object-oriented programming syntax
- Chapter 9 Arrays and matrices
- Chapter 10 Input and output streams
- Chapter 11 References
- Chapter 12 Pointers and dynamic memory allocation
- Chapter 13 Memory management
- Chapter 14 The static keyword, multiple and virtual inheritance, templates and the STL
- Chapter 15 Creating a Java development environment
- Chapter 16 Basic Java programming constructs
- Chapter 17 Java classes and objects
- Chapter 18 Advanced Java features
- Chapter 19 Introductory numerical analysis
- Chapter 20 Linear algebra
- Chapter 21 Fourier transforms
- Chapter 22 Differential equations
- Chapter 23 Monte Carlo methods
- Chapter 24 Partial differential equations
- Index
Chapter 2 - Octave programming
Published online by Cambridge University Press: 05 June 2012
- Frontmatter
- Contents
- Chapter 1 Introduction
- Chapter 2 Octave programming
- Chapter 3 Installing and running the Dev-C++ programming environment
- Chapter 4 Introduction to computer and software architecture
- Chapter 5 Fundamental concepts
- Chapter 6 Procedural programming basics
- Chapter 7 An introduction to object-oriented analysis
- Chapter 8 C++ object-oriented programming syntax
- Chapter 9 Arrays and matrices
- Chapter 10 Input and output streams
- Chapter 11 References
- Chapter 12 Pointers and dynamic memory allocation
- Chapter 13 Memory management
- Chapter 14 The static keyword, multiple and virtual inheritance, templates and the STL
- Chapter 15 Creating a Java development environment
- Chapter 16 Basic Java programming constructs
- Chapter 17 Java classes and objects
- Chapter 18 Advanced Java features
- Chapter 19 Introductory numerical analysis
- Chapter 20 Linear algebra
- Chapter 21 Fourier transforms
- Chapter 22 Differential equations
- Chapter 23 Monte Carlo methods
- Chapter 24 Partial differential equations
- Index
Summary
For small programs or rapid prototyping of ideas and methods, the commercial MATLAB® language, or its freeware alternatives, offers a practical alternative to C++ or FORTRAN. In this book, the free GNU Octave implementation is discussed from a scientific programming perspective. After becoming familiar with the central language constructs summarized below, the built-in Octave help facilities conveniently provide information on specialized, infrequent commands.
Obtaining octave
The Windows and Mac installation packages for GNU Octave are currently located at octave.sourceforge.net. Linux versions are available at the main Octave web site www.gnu.org/software/octave. When the program is installed, a variety of additional packages and the creation of a database of C++ components accessible by the editor can be selected. Unless space is an issue, these options should be chosen.
Command summary
(1) Running Octave. After clicking on the Octave icon, statements are entered interactively by typing into the resulting command window at the > prompt. An Octave session is terminated by typing quit.
(2) System commands. To change from the startup directory (folder) to the directory that either contains or will contain program files, type cd X:\dir1\dir2\ . . . \programDirectory, where X is the partition (logical drive) containing the desired directory and \dir1\dir2 . . . \programDirectory is an ordered sequence of the names of the directories enclosing the directory, \programDirectory, in which the program is located. If one or more directory names contain spaces, the entire expression containing these names must be surrounded by double apostrophes ("), e.g. cd "X:\My Documents". Representative operating-system commands that can be issued from the Octave prompt include mkdir directoryName, which creates the directory directoryName, rmdir directoryName, which removes this directory, dir or Is which display the contents of a directory, .., which moves to one directory higher in the directory tree, ., which represents the current directory, rename file1.1 file2.2, which renames the file file1.1 to the name file2.2, and copy, which similarly copies a file.
…
- Type
- Chapter
- Information
- A Short Course in Computational Science and EngineeringC++, Java and Octave Numerical Programming with Free Software Tools, pp. 5 - 14Publisher: Cambridge University PressPrint publication year: 2012