From 485ae8004cd565f05454f41689e2973be25c3efb Mon Sep 17 00:00:00 2001 From: rink <rink@dtu.dk> Date: Mon, 2 Oct 2017 09:54:18 +0200 Subject: [PATCH] Started fixing formatting, giving up for now --- python_vs_matlab.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/python_vs_matlab.md b/python_vs_matlab.md index 37dd5da..532863d 100644 --- a/python_vs_matlab.md +++ b/python_vs_matlab.md @@ -5,11 +5,34 @@ but modified to 1) be in markdown, 2) fix some errors, and 3) add more detail. This is very much a work in progress. This re-formatting is taking some time. +<table> + <tr> + <th>Python</th> + <th>Matlab</th> + </tr> + <tr> + <td><ul> + <li>numeric variables are double precision if decimal added</li> + </ul> + <pre><code>a = 5. # this is a float +a = 5 # this is an int</code></pre> + </td> + <td><ul> + <li>numeric variables are double precision by default</li> + </ul> + <pre><code>a = 5.0; % this is a double</code></pre> + </td> + </tr> + <tr> + <td>Eve</td> + <td>Jackson</td> + </tr> +</table> + +# test + -Python | Matlab -| ------------- |-------------| -numeric variables are double precision if decimal specified <br /> no semicolon needed to supress output <br /> `a = 5. # this is a float` <br /> `a = 5 # this is an int` | numeric variables are double precision by default <br /> `a = 5.0; % this is a double` numeric arrays are objects defined in NumPy package <br /> indexes start at 0 in Python <br /> structures are defined by indentation, no 'end' <br /> `A = np.empty(10) # initialize array A`| array indexes start at 1 in Matlab <br /> indentation is for readability only <br /> `for i=1:10` <br /> ` A(i) = i;` for i in range(1,11): | end    A.append(i) | A % display contents of A -- GitLab