Editing Tips and tricks

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 fewer characters).
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 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>
<tr><td>range</td><td><code>0.1:0.2:0.9</code></td><td><code>Range (0.1, 0.9, 0.2).matrix_value ()</code></td></tr>
</table>
</table>


Line 170: Line 169:
====Other references====
====Other references====


*MATLAB array manipulation tips and tricks by Peter Acklam: https://web.archive.org/web/20151030212438/http://home.online.no/~pjacklam/matlab/doc/mtt/index.html
*MATLAB array manipulation tips and tricks by Peter Acklam: http://home.online.no/~pjacklam/matlab/doc/mtt/index.html
*The MathWorks: Code Vectorization Guide: http://www.mathworks.com/support/tech-notes/1100/1109.html
*The MathWorks: Code Vectorization Guide: http://www.mathworks.com/support/tech-notes/1100/1109.html


[[Category:Tips and tricks]]
[[Category:Tips and tricks]]


===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 ([https://web.archive.org/web/20140217072457/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]).
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 some Linux distributions, this just takes a few commands. For instance, on Ubuntu, it usually suffices to run
On some Linux distributions, this just takes a few commands. For instance, on Ubuntu, it usually suffices to run
Please note that all contributions to Octave may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Octave:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)

Templates used on this page: