annotate README.md @ 389:d4061763a56b

Delete and no longer build Python extension module * Makefile.am (_pytave.la): Delete all declarations. * configure.ac (PYTAVE_MODULE_INSTALL_PATH): Delete hack. * pytave.cc: Delete.
author Mike Miller <mtmiller@octave.org>
date Mon, 03 Apr 2017 12:11:25 -0700
parents 809f2c7f76c7
children 14b134ffdc24
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
1 Pytave README
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
2 =============
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
3
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
4 For installation instructions specific for Pytave, please see the
170
809f2c7f76c7 * README.md: Fix markdown links to other files and project urls
Mike Miller <mtmiller@octave.org>
parents: 159
diff changeset
5 [INSTALL.md](INSTALL.md) file.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
6
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
7 Contents of this document
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
8 -------------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
9
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
10 1. What is Pytave?
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
11 2. Gotchas
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
12 3. Pytave and multi-threading
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
13 4. Python/Octave cheat sheet
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
14
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
15 What is Pytave?
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
16 ===============
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
17
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
18 Pytave enables Python scripts to use existing m-files (Octave/Matlab
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
19 scripts) for numerical calculations. The Octave language interpreter is
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
20 embedded as a module to Python.
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
21
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
22 Example use
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
23 -----------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
24
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
25 Calling Octave code in the interactive Python interpreter:
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
26
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
27 >>> import pytave
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
28 >>> pytave.feval(1, "cos", 0)
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
29 (1.0,)
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
30
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
31 Goals
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
32 -----
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
33
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
34 Pytave strives to uphold these points
4
e84a2afb3342 Bootstrapping instructions
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
35
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
36 * Good out of the box experience
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
37 * Good-natured implicit type conversions, no strange PyApple ->
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
38 octave_orange -> PyBanana chains
4
e84a2afb3342 Bootstrapping instructions
David Grundberg <individ@acc.umu.se>
parents: 0
diff changeset
39
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
40 Features
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
41 --------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
42
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
43 A short list of what Pytave is capable of
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
44
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
45 * Implicit type conversions between Python and Octave. Supports all
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
46 NumPy integer and floating point matrices
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
47 * Architecture independent - no assumption on endian type or integer
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
48 sizes
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
49 * Supports cell <-> list and struct <-> dict conversions.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
50
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
51 Project homepage
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
52 ----------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
53
170
809f2c7f76c7 * README.md: Fix markdown links to other files and project urls
Mike Miller <mtmiller@octave.org>
parents: 159
diff changeset
54 [https://bitbucket.org/mtmiller/pytave](https://bitbucket.org/mtmiller/pytave)
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
55
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
56 Using/hacking
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
57 -------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
58
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
59 You need the Mercurial version control software (hg). Clone the repo
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
60 with:
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
61
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
62 $ hg clone https://bitbucket.org/mtmiller/pytave
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
63
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
64 You will now have a directory called `pytave` with source code for the
170
809f2c7f76c7 * README.md: Fix markdown links to other files and project urls
Mike Miller <mtmiller@octave.org>
parents: 159
diff changeset
65 module. Read the [INSTALL.md](INSTALL.md) file for building instructions.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
66
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
67 Gotchas
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
68 =======
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
69
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
70 Unfortunately, the implicit conversion is not bijective (there is not a
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
71 one-to-one relation between Octave and Python values). Pytave users
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
72 should be aware of the following cases.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
73
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
74 Numeric row vectors to Octave matrices
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
75 --------------------------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
76
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
77 Numeric row vectors are converted to Octave 1xN matrices; returned 1xN
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
78 matrices will become 1xN numerical arrays, not row vectors. As an
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
79 example, a NumPy array with shape == (3,) will become (1, 3) when
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
80 converted back and forth.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
81
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
82 Octave cells to Python lists
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
83 ----------------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
84
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
85 Only row cell arrays can be converted to Python lists.
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
86
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
87 Python dictionaries to Octave structures
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
88 ----------------------------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
89
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
90 Dictionaries converted to structures must only have string keys. This is
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
91 because Octave structures only allow string keys. Keys must also be
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
92 valid Octave identifiers.
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
93
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
94 As Octave structures are built using cells, simple variables are
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
95 upgraded to cells when a dictionary is converted. A dictionary
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
96
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
97 {"name": "Pytave"}
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
98
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
99 thus will become
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
100
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
101 ans =
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
102 {
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
103 name = Pytave
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
104 }
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
105
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
106 in Octave. In this listing, Octave is hiding the fact that the value is
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
107 wrapped in a cell. Converted back, cells are converted to Python lists.
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
108 The re-converted Python dictionary will read
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
109
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
110 {"name": ["Pytave"]}
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
111
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
112 which is natural effect because of the way Octave handles structures.
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
113
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
114 The list values in dictionaries to be converted must be of equal length.
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
115 All restrictions demanded by the Octave `struct` built-in applies.
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
116
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
117 Pytave and multi-threading
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
118 ==========================
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
119
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
120 Pytave does not handle reentrant calls. It is not thread-safe, and you
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
121 cannot make several Pytave calls in parallel. There are no safety
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
122 harnesses in Pytave (unlike e.g. PySqlite), and Pytave will not stop you
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
123 if you try to make concurrent calls. The behavior is undefined. It is
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
124 not possible to run several calculations in parallel.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
125
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
126 That being said, it is possible to do other things while one Pytave call
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
127 is running. Pytave is aware of the Global Interpreter Lock. The lock
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
128 will be released while the Octave interpreter is running, allowing you
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
129 to have other Python threads to run in parallel with the one Octave
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
130 call.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
131
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
132 Python/Octave cheat sheet
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
133 =========================
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
134
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
135 Octave and Python share some syntax elements, which unfortunately makes
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
136 it harder to distinguish between the languages. Here are some examples
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
137 in both languages, showing how to build related constructs.
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
138
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
139 Create a 2x3 matrix
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
140 -------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
141
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
142 octave:1> [1, 1, 1; 2, 2, 2]
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
143 python>>> array([[1, 1, 1], [2, 2, 2]])
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
144
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
145 Create a 3x2 matrix
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
146 -------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
147
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
148 octave:1> [1, 1; 2, 2; 3, 3]
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
149 python>>> array([[1, 1], [2, 2], [3, 3]])
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
150
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
151 Create a 1x3 matrix
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
152 -------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
153
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
154 octave:1> [1, 1, 1]
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
155 python>>> array([[1, 1, 1]])
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
156
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
157 Create a row vector
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
158 -------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
159
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
160 Not applicable to Octave.
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
161
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
162 python>>> array([1, 1, 1])
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
163
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
164 Note: Python row vectors will be converted to Octave 1xN matrices.
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
165
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
166 Create a 3x1 matrix
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
167 -------------------
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
168
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
169 octave:1> [1; 2; 3]
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
170 python>>> array([[1], [2], [3]])
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
171
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
172 Create a 1x1 structure/dictionary
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
173 ---------------------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
174
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
175 octave:1> struct("x", 1, "y", 2)
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
176 python>>> {"x": 1, "y": 2}
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
177
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
178 Create a 1x2 structure array/dictionary containing lists of length 2
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
179 --------------------------------------------------------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
180
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
181 octave:1> struct("firstname", {"David", "Håkan"}, ...
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
182 "lastname", {"Grundberg", "Fors Nilsson"})
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
183 python>>> {"firstname": ["David", "Håkan"], \
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
184 "lastname": ["Grundberg", "Fors Nilsson"]}
0
4da14cce0890 First launchpad.net check in.
David Grundberg <c04dgg@cs.umu.se>
parents:
diff changeset
185
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
186 Create a 1x3 cell array/list
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
187 ----------------------------
33
1d7bab3bc745 Documentation
David Grundberg <individ@acc.umu.se>
parents: 29
diff changeset
188
159
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
189 octave:1> {"foo", "bar", "baz"}
a323f9fae46b doc: Reformat INSTALL and README in Markdown
Mike Miller <mtmiller@octave.org>
parents: 152
diff changeset
190 python>>> ["foo", "bar", "baz"]