Right now the first two examples are the following
+-----------------------------+--------------------------+---------------------------------------+--------------------------+
| Operation | MATLAB | Python | Julia |
+=============================+==========================+=======================================+==========================+
| | .. code-block:: matlab | .. code-block:: python | .. code-block:: julia |
| | | | |
| Create a row vector | A = [1 2 3] | A = np.array([1, 2, 3]) | A = [1 2 3] |
+-----------------------------+--------------------------+---------------------------------------+--------------------------+
| | .. code-block:: matlab | .. code-block:: python | .. code-block:: julia |
| | | | |
| Create a column vector | A = [1; 2; 3] | A = np.array([1, 2, 3]).reshape(3,1) | A = [1; 2; 3] |
+-----------------------------+--------------------------+---------------------------------------+--------------------------+
This isn't quite accurate. In the row vector example both matlab and Julia would create an array A that has dimensions (1, 3), whereas in python A would have shape (3,)
In the second example matlab and python would have size (3, 1), while the Julia would have size (3,).
Here are some suggestions for how we might improve these examples:
Make sure they all return something with the same number of dimensions in all 3 languages
Show an example of creating a 1d array in python and Julia and noting that it isn't possible in matlab
Highlight that [1, 2, 3] and [1; 2; 3] are pretty much equivalent in Julia (give you a 1d array with size (3,)
Right now the first two examples are the following
This isn't quite accurate. In the row vector example both matlab and Julia would create an array
A
that has dimensions(1, 3)
, whereas in pythonA
would have shape(3,)
In the second example matlab and python would have size
(3, 1)
, while the Julia would have size(3,)
.Here are some suggestions for how we might improve these examples:
[1, 2, 3]
and[1; 2; 3]
are pretty much equivalent in Julia (give you a 1d array with size(3,)