Editing Tips and tricks
Jump to navigation
Jump to search
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 59: | Line 59: | ||
=== replace help with man === | === replace help with man === | ||
If you use octave too much, you'll find yourself trying to use {{Codeline|help}} instead of {{Codeline|man}} on bash. This function will fix that so you can use {{Codeline|man}} in your octave instance (you can also do the opposite, create a {{Codeline|help}} alias in bash but {{Codeline|man}} has | If you use octave too much, you'll find yourself trying to use {{Codeline|help}} instead of {{Codeline|man}} on bash. This function will fix that so you can use {{Codeline|man}} in your octave instance (you can also do the opposite, create a {{Codeline|help}} alias in bash but {{Codeline|man}} has fewwer characters). | ||
{{Code|alias to help|<pre> | {{Code|alias to help|<pre> | ||
Line 78: | Line 78: | ||
<tr><td>element multiplication</td><td><code>A.*B</code></td><td><code>product(A,B) </code></td></tr> | <tr><td>element multiplication</td><td><code>A.*B</code></td><td><code>product(A,B) </code></td></tr> | ||
<tr><td>element division</td><td><code>A./B</code></td><td><code>quotient(A,B) </code></td></tr> | <tr><td>element division</td><td><code>A./B</code></td><td><code>quotient(A,B) </code></td></tr> | ||
<tr><td>transpose*</td><td><code>A | <tr><td>transpose*</td><td><code>A'</code></td><td><code>A.transpose()</code></td></tr> | ||
<tr><td>select element m,n of A**</td><td><code>A(m,n)</code></td><td><code>A(m-1,n-1)</code></td></tr> | <tr><td>select element m,n of A**</td><td><code>A(m,n)</code></td><td><code>A(m-1,n-1)</code></td></tr> | ||
<tr><td>select row N of A**</td><td><code>A(N,:)</code></td><td><code>A.row(N-1)</code></td></tr> | <tr><td>select row N of A**</td><td><code>A(N,:)</code></td><td><code>A.row(N-1)</code></td></tr> | ||
Line 113: | Line 113: | ||
<tr><td>number of rows</td><td><code>size(A,1)</code></td><td><code>A.rows()</code></td></tr> | <tr><td>number of rows</td><td><code>size(A,1)</code></td><td><code>A.rows()</code></td></tr> | ||
<tr><td>number of columns</td><td><code>size(A,2)</code></td><td><code>A.cols()</code></td></tr> | <tr><td>number of columns</td><td><code>size(A,2)</code></td><td><code>A.cols()</code></td></tr> | ||
</table> | </table> | ||
Line 177: | Line 176: | ||
===Changing BLAS=== | ===Changing BLAS=== | ||
Many Octave functions are wrappers to optimized numerical libraries, notably BLAS and ATLAS. It is possible to achieve impressive performance gains by simply using a library tuned to your platform. One example is using OpenBLAS to replace the default BLAS implementation ([http://www.stat.cmu.edu/~nmv/2013/07/09/for-faster-r-use-openblas-instead-better-than-atlas-trivial-to-switch-to-on-ubuntu/ further details]). | |||
On Linux, this just takes a few commands: | |||
sudo apt-get install libopenblas-base libatlas3gf-base | |||
Then run | |||
and | sudo update-alternatives --config libblas.so.3 | ||
and select the openblas option. |