How to read Octave documentation

hello everybody, newbie here. I have trouble reading Octave documentation, or Matlab or any other documentation. Is there any certain way to get accustomed to documentation’s syntax? I have to read and re-read many times, and still takes a few erroneous lines of code before I get what documentation tries to tell me. Is this normal? How do you manage, what are your tricks? Thank you in advance fellas.

1 Like
  1. How long have you been using Octave / Matlab ? a week, a month, an year, few years ?
  2. How frequently do you use it ? Daily, once in a week, one in few months ?
  3. help functionname in the command window for most functions give an example usage. Do you copy that and try it out before using the function in your code ? Some functions require the data to be set up in a particular format before calling the function; e.g. functions which take outputs of meshgrid function as their input. I try to copy the snippet given in the example / documentation into my code and modify that to minimize errors.
  4. For frequently used functions, eventually I memorize it due to frequent usage. For infrequently used functions, I don’t mind the multiple trials since they don’t finally affect my productivity due to infrequent usage.
1 Like

I began learning Octave in second half of November. I give it my honest effort, from one to 3 or more hours a day. I am comfortable using everything I learnt from youtube tutorials - Hanshaw University is best! - but when it comes to advancing on my own, using documentation alone, I have a really hard time comprehending.

I often can’t distinguish between replacement words for what would be my file or variable, and Octave command, or specifiers. I have trouble finding what commands I really need, and documentation often doesn’t specify what must be done prior, for this particular command to work.

As far as trying not to accidentally overwrite octave’s objects with my own object of same name (a very common example being the usage of the letter i to use in a loop), I simply type the proposed name in the Octave command window (after clearing the workspace variables and ensuring that relevant packages are loaded) and see if Octave already recognizes it.

>> i
ans =  0 + 1i

>> quad
error: Invalid call to quad.  Correct usage is:
 -- Q = quad (F, A, B)
...

>> jim
error: 'jim' undefined near line 1, column 1

For discovering new commands, I use some web search engine first. For example searching “function for numerical integration in Octave Matlab” gave me GNU Octave: Numerical Integration as the second result. This is a link to the Octave documentation itself. The documentation has some code examples in it.

If the web search doesn’t turn useful results, I turn to forums (like this one for example).

As to what must be done prior, there will usually be code examples in the documentation.
Three-Dimensional Plots (GNU Octave (version 6.4.0)) clearly mentions that the mesh surf commands are usually fed with outputs from the meshgrid function.

The wireframe mesh is plotted using rectangles.
The vertices of the rectangles [x, y] are typically
the output of `meshgrid`.

nice! thank you.