summaryrefslogtreecommitdiffstats
path: root/software/matlab.page
blob: 54daa3dc9336c0451269fe40184262dd974bb90d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
format: rst
toc: no
...

==================
Matlab
==================

.. warning::
    Stub, just getting started

`cyclismo.org <http://www.cyclismo.org/tutorial/matlab/matrix.html>`_ has a good tutorial.

Matrix Syntax
------------------

Create a new matrix:

    A = [1,2,3,4]

Select the first element of a matrix, **zero-indexed**:

    A(1)

Create a one dimensional matrix:

    B = [ [1,2,3], [4,5,6], [7,8,9] ]


Create a two dimensional matrix:

    B = [ [1,2,3],
          [4,5,6],
          [7,8,9] ]


Matrix Operations
------------------
``inv`` 
    inverts a square matrix

Meta-Commands
------------------
Placing a semicolon at the end of a line prevents the output from being printed to screen.

``whos``
    Displays variables and their size
``format long``/``format short``
    Selects either 4 or 14 decimal place display