FAQ: Difference between revisions

1,004 bytes added ,  3 July 2017
(→‎Why GNU Octave?: Corrected pronunciation of "GNU")
Line 504: Line 504:


Note: [https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html Automatic expansion of dimensions] was added to MATLAB R2016b.
Note: [https://www.mathworks.com/help/matlab/matlab_prog/compatible-array-sizes-for-basic-operations.html Automatic expansion of dimensions] was added to MATLAB R2016b.
===Documentation strings===
Octave allows extensive formatting of the help string of functions using Texinfo. The effect on the online documentation is relatively small, but makes the help string of functions conform to the help of Octave’s own functions. However, the effect on the appearance of printed or online documentation will be greatly improved.
===Test functions===
Octave allows to add self-tests to user defined functions. Tests are put after function definition in specially commented block.
 
  function mult = a(val)
          mult = val.*2;
  endfunction
  %!test
  %! assert (a(3), 6);
Such a function can be tested for valid outputs by following code:
  octave:1> test a
  PASSES 1 out of 1 test
===Demonstration Functions===
Example code block can be part of function file in a similar manner as test functions. For example to run demo for function multinom of package specfun, use:
  demo multinom
===Powerfull assert===
Function assert have extended input possibilities.


==How does Octave solve linear systems?==
==How does Octave solve linear systems?==
5

edits