kesto.de Cheatsheets

octave

Operate on each element of a vector

values = [6, 7, 2, 8, 5, 4, 2, 9].*2

Create vector from range

values = 5:10

Plot discrete values (returns handle)

H = bar(values)

Create vector/matrix with zeros

x = zeros(1, 5)

Loops

for i in [1, 3, 6]
  i
end

Cell Arrays - mixed data types; for example with strings

x = {'a', 'b', 'c'}