The project is MATLAB coursework and had never been run outside MATLAB. Two
things stop it in Octave, both found by running it rather than reading it:
* newtonr.m called sym/matlabFunction unconditionally. Octave has no
matlabFunction, so the file died before the first iteration with
"'sym' undefined near line 12, column 5". The derivative is now taken
from the Symbolic Math Toolbox when it is there and from a central
difference otherwise. The method and its results are unchanged: on the
test functions the numeric derivative agrees with the analytic one to
2.3e-16 or better.
* secant.m and newtonr.m built plot labels with "a" + i + "b". A
double-quoted literal is a char array in Octave, not a string, so the
addition became numeric and secant.m stopped at line 58 with
"operator +: nonconformant arguments (op1 is 1x10, op2 is 1x2)". The
labels are now built by concatenation and the text is identical.
No mathematics was changed. The defects that were found are left in place and
documented instead: tab = (max) is not a preallocation, newtonr returns
without assigning x1 when f'(x0) == 0, secant rejects an interval without a
sign change, and none of the three reports exhaustion of the iteration cap.
Added so the behaviour can be checked instead of asserted:
* tests/run_tests.m - 13 checks against roots known analytically, solvers
called at tol=1e-10, assertion tolerance 1e-6, exit 1 on any failure
* a Makefile with test, demo, run and clean, and tests/demo.m
* README.md in the house format; README.txt is kept as the original note
* .gitignore for MATLAB autosave files and the captured plot output
Verified on the raspberry pi with Octave 9.4.0: make test reports 13 checks,
0 failures and exits 0, and a deliberately wrong expected root gives exit 1.
projetodlg.m was not made to run under Octave: it is built from MathWorks
dialogs and needs a display.
O repo era publico e espelhado sem licenca e nao tem codigo de terceiros. MIT
foi a licenca decidida para o catalogo; ano = primeiro commit (2022). O
README.txt original fica como esta.