Octave false position

968 Views Asked by At

i'm try to write some code in octave based in false position method.

So, here it is:

this is the code

And I get the follow error:

"parse error near line 40 of file C:\Users\HP...falsa.m

syntax error

else"

So, the point here, is that I actually know the meaning "parse error near the line 40" warning (it means something octave cannot understand). But a already tried to fixed and i´m still get the error.

What i'm missing?

Thanks for any help. Actually, i´m think my code is not very efficient. Some help would be great. Thanks again.

1

There are 1 best solutions below

1
On BEST ANSWER

The second if statement, if fun(x0)<0, has no corresponding endif, which should go before the else on line 40.