Octave Cheat Sheet



Printable Scales

Matlab Cheat Sheet Arrays/lists of numbers x=1 2 3 x is an array with 3 entries: 1, 2, and 3. X=1:10:4 The entry of x runs from 1 to 10, increased by 4 each time. X=1:10 The entry of x runs from 1 to 10, increased by 1 each time. X=linspace(1,10,19) There are 19 equally spaced values in x running from 1 to 10. Use Octave’s built-in routines by first defining the function to be integrated: function res = F ( x ) res=exp(-x.^2); endfunction result=!quadgk( 'F', 0, 3 ) Fourier transform! Use fft to calculate the Fourier transform of a function. It is most efficient to define it on a grid that is a power of two: N=2^8; t=linspace(-30,30,N). Chapter 3: Working with Octave: Functions and Plotting 65 Octave functions 65 Mathematical functions 66 Time for action – using the cos function 66 Polynomials in Octave 68 More complicated mathematical functions 69 Time for action – putting together mathematical functions 70 Helper functions 71 Generating random numbers 72 min and max 72. For Linux, easy way is apt-get install octave. Might want to do apt-get autoremove before. 3 How to install additional packages? On octave 3.8, I found an install file called buildpackages.m in the folder C:OctaveOctave-3.8.0src which is where octave 3.8 was installed using the window installer mentioned above. Then from octave I simply run the above file. George Goodman’s Harmonica Cheat Sheets is a combination of four great tools to kick start your harmonica playing. The Blues Harp Cheat Sheet This Cheat Sheet provides chords, cross harp key, 12 Bar Blues Progression, and Blues Scale harmonica tabs covering all 12 keys. Harmonica Chord Cheat Sheet All major keys or scales consist of 7 notes.

Below are some scales and a few pieces of music written by violin teachers for their students. These can be freely copied for non-commercial use as long as the author's name and copyright information remains intact. Notify Julie of any errors and we will fix asap.
VIOLIN SCALESVIOLA SCALES
Major, 1 octave
A Major
D Major
G Major
C Major
F Major
Bb Major
Eb Major
Minor, 1 octave
F# Minor
B Minor
E Minor
A Minor
D Minor
G Minor
C Minor
Major, 1 octave
A Major
D Major
G Major
C Major
F Major
Bb Major
Eb Major
Minor, 1 octave
F# Minor
B Minor
E Minor
A Minor
D Minor
G Minor
C Minor
Major, 2 octave
B Major *
E Major
A Major
D Major *
G Major
C Major *
F Major **
Bb Major
Eb Major *
Ab Major
Db Major **
Minor, 2 octave
C# Minor *
F# Minor **
B Minor
E Minor *
A Minor
D Minor *
G Minor
C Minor *
F Minor **
Major, 3 octave **
B Major
E Major
A Major
D Major
G Major
C Major
F Major
Bb Major
Eb Major
Ab Major
Db Major
Gb Major
Minor, 3 octave **
G# Minor
C# Minor
F# Minor
B Minor
E Minor
A Minor
D Minor
G Minor
C Minor
F Minor
Bb Minor
Eb Minor
* Requires 3rd position
** Requires 5th position or above

VIOLIN MUSIC

Another arrangment of Twinkle
Twinkle for 3 violins - Score
Twinkle Violin I
Twinkle Violin II
Twinkle Violin III
Twinkle arranged for 3 different levels of violinists. Written so all my students could play together at a recital. Part I is the main melody for the beginner. Part II is still not hard, but hopefully not too boring for the intermediate and above students just to have fun with. Part III has a few high 3rd fingers in it, but is still for the beginner. Has the feeling of a canon, but isn't really in canon form.
Beginning Violin Trio by William Joel
Strolling Full Score
Strolling 1st Violin
Strolling 2nd Violin
Strolling 3rd Violin

Fiddle trio:Devil Among the Tailors (score)
Traditional tune, Arr. Julie Tebbs
I always seem to need arrangements that include varying levels of playing ability. This one has violin 1 and 2 at an intermediate level and violin 3 at a beginning level.

CHRISTIAN MUSIC:

Octave Cheat Sheet

Jesus, Lover of My Soul, violin/cello duet:
Violin part
Cello part
How Firm a Foundation, violin/piano:
Violin and Piano score
The Wintry Day, Violin duet w/piano:
Violin I and II
Piano

Add your own music: If you have written string music and would like your piece included on this page, please email Julie. Only original works that you are willing to distribute for free please.
VIOLA and CELLO: Yes! We have plans to add these scales as well. This will be a work in progress. If you would like to help us write out scales or have some to post here, let us know! All pieces are displayed in PDF format, which requires Adobe Acrobat in order to read it. You can download Adobe Acrobat here for free if you need it.

Octave CheatSheet

GNU Octave is a high-level interpreted language, primarily intended for numerical computations.
(via GNU Octave)

Basics

  • not equal ~=
  • logical AND &&
  • logical OR ||
  • logical XOR xor(1,0)

A semicolon ; at the end of a line will suppress the output

v = 1:5 creates a 1x5 Matrix (linear vector) with the numbers one to five.v = 1:0.1:2 also creates a vector but with the numbers from one to two with a step size of 0.1.

To display the 5th number of this vectors use v(5). Beware that ocatve is 1 based.Displaying a range of numbers use v(3:5) to display the 3rd, 4th, and 5th number.

Useful functions

help _function name_ will give you the man page of this function.

ones(x [, y]) creates a matrix with ones. If only x is provided it is a squared matrix of size x. If y is provides it has the size x cross y.

zeros(x [, y]) behaves the same as ones() but will give a zero-matrix.

rand(x [, y]) Return a matrix with random elements uniformly distributed on the interval (0, 1).

randn(x [, y]) Return a matrix with normally distributed random elements having zero mean and variance one. The arguments are handled the same as the arguments for rand.

hist(x [, y]) Produce histogram counts of plots. y is the number of buckets.

eye(x [, y]]) Produces an identity matrix.

size(A [, DIM]) Return the number of rows and colums of A.
DIM = 1 number rows
DIM = 2 number columns

length(A) Return the length of the object A. For Matrix objects, the length is the number of rows or columns, whichever is greater (this odd definition is used for compatibility with MATHLAB).

who Lists currently defined varibales matchin the given pattern.whos Provide detailed information on currently defined variables.

sum(a), sum(A,1) sums up all columns.sum(A,2) sums up all rowsprod(a) takes the product of each column

floor(a) rounds downceil(a) rounds up

clear will clear all variables or only the ones who are named.

Save and Load Data

You can save and load data in octave easily with the two commands save and load.

To save a specific variable v to the file filename.dat

Loading data is as simple as saving.

The file will be saved in the current directory and will be loaded from the current dir.

Matrixes

Let A be the matrix: A = [1 2; 3 4; 5 6]

The semicolon indicates a new row and a space or comma is a new column. Instead of typing a semicolon it is also possible to hit enter.

Output last element in Matrix

Display Data

Assign new Data

Concatinating Matrixes

Transpose a matrix or a vector

max values and find()

To find the largest value in a matrix you can either chain to max() functions or take the complete matrix.

You can search thru matrixes and vectors with a condition

Flipping a matrix

Sometimes it is necessary to flip a matrix upsidedown.

Octave Cheat Sheet Pdf

Hint: useful in combination with the identity matrix flipud(eye(4))

Sum of diagonals in a square matrix

Example: A magic matrix is a square matrix where the sum of rows, columns and diagonals are the same result. Let's check the sum of diagonals

Inverse matrix

There exists serveral ways to create a inverse matrix in octave

Ploting

plot(x, y) plot a graph with x as x-axis and y as y-axis. x and y has to match in length.

hold on will plot updated in the current plot instead of replace the current plot.

plot(x, y2, 'r') will plot a graph in red.

axis([a b c d]) X-axis will start at a and goes to b, and Y-axis will start from c and goes to d. Example axis([0.5 1 -1 1])

clf; clear figure

imagesc(A) grid of colors for matrixcolorbar display colorbar, kind of legendcolormap gray display only gray-scale

Example: imagesc(A), colorbar, colormap gray;

Labels

xlabel('Zoidberg'), ylabel('Bender'), legend('fry', 'lila'), title('Futurama')

print -dpng 'myPlot.png' export plot as PNG file. For other format see help plot

Octave 4 Cheat Sheet Pdf

close close the plot, as simple as that.

figure(1); plot(x, y) plot graph as figure 1figure(2); plot(x, y2) plot graph as figure 2

subplot(x,y,POS); plot multiple graphs in one windows as a X-by-Y grid at position POS

Octave Cheat Sheet Excel

Functions & control statements

Functions are saved in files with the file-ending .m for MATHLAB. The syntax is quite simple:

Call your function in octave like function_name(5). You have to be in the same dir as the file or add it to your search-path (addpath()).

for- and while-loops are easy and useful in octave.

It is also possible to use if-conditions

Various

Football

The following commands can be used within octave:

SheetOctave

Octave Cheat Sheet Download

  • cd
  • pwd
  • ls [-la]
  • dir

It is possible to change octave's prompt. Use PS1('>> '); to change the promt to >>

Octave Cheat Sheets

disp(a); will display the variable a. Useful in loops or conditions.

magic(x) Create an N-by-N magic square.

For more controll in displaying stuff use sprintf('%i', a);. It follows the C-standard.

format long or format short adjusts the length of output in octave.

addpath('_path_') will add a path to the search-path for octave. I.e. Octave will also look in this path for functions and files.