PacktLib: GNU Octave Beginner's Guide

GNU Octave

Credits

About the Author

About the Reviewers

www.PacktPub.com

Preface

Introducing GNU Octave

So what is GNU Octave?

Installing Octave

Time for action - building Octave from source

Checking your installation with peaks

Time for action - testing with peaks

Customizing Octave

Time for action - creating an Octave home directory under Windows

Time for action - editing the .octaverc file

Installing additional packages

Time for action - installing additional packages

Getting help

The behaviour of the Octave command prompt

Summary

Interacting with Octave: Variables and Operators

Simple numerical variables

Time for action - manipulating arrays

Structures and cell arrays

Time for action - instantiating a structure

Time for action - instantiating a cell array

Getting information

Time for action - using whos

A few things that make life easier

Basic arithmetic

Time for action - doing addition and subtraction operations

Time for action - doing multiplication operations

Time for action - doing left and right division

Comparison operators and precedence rules

Time for action - working with precedence rules

A fe´╗┐w hints

Summary

Working with Octave: Functions and Plotting

Octave functions

Time for action - using the cos function

Time for action - putting together mathematical functions

Time for action - trying out floor, ceil, round, and fix

Time for action - using Octave for advanced linear algebra

Two-dimensional plotting

Time for action - making your first plot

Time for action - changing the figure properties

Time for action - having multiple graphs in the same figure

Time for action - making an inset

Three-dimensional plotting

Time for action - making a surface plot

Time for action - plotting parametric curves

Summary

Rationalizing: Octave Scripts

Writing and executing your first script

Time for action - making your first script

Time for action - interacting with the user

Statements´╗┐

Added flexibility C style input and output functions

Saving your work

Loading your work

Summary

Extensions: Write Your Own Octave Functions

Your first Octave function

Time for action - programming the minmax function

Writing and applying user-supplied functions

Time for action - using lsode for numerical integration

More advanced function programming: Monte Carlo integration

Time for action - vectorizing the Monte Carlo integrator

Summary

Making Your Own Package: A Poisson Equation Solver

The Poisson equation two examples of heat conduction

Finite differencing

Time for action - instantiating a sparse matrix

Implementation and package functions

Time for action - using imagesc

Time for action - comparing with analytical solution

Time for action - solving a two-dimensional Laplace equation

The pois-solv package

Summary

More Examples: Data Analysis

Loading data files

Simple descriptive statistics

Function fitting

Time for action - using polyfit

Time for action - calculating the correlation coefficient

Time for action - using leasqr

Fourier analysis

Time for action - using the fft function

Time for action - analysing the exchange rate

Time for action - applying a low pass filter

Summary

Need for Speed: Optimization and Dynamically Linked Functions

A few optimization techniques

Time for action - using tic and toc

Dynamically linked functions

Time for action - writing a "Hello World" program

Time for action - checking user inputs and outputs

Time for action - revisiting the Sel'kov model

Summary

Pop quiz - Answers

Pop quiz - Answers

Pop quiz - Answers

Pop quiz - Answers

Pop quiz - Answers

Pop quiz - Answers