|
From: | Ben Abbott |
Subject: | Re: why is octave such a crap? |
Date: | Wed, 17 Aug 2016 11:15:57 -0400 |
I assume you placed the example above in '/user/ME/test.m'? The problem is that test.m is being parsed as a function and the parser is confused because the file name implies the function name is test() but the function declaration specifies octsux(). If the first line of your file is anything other than a comment or a function declaration it would work. Try placing the text below in usux.m ## start 1; function retval=octsux(x) if(x<1.3) % -inf<x<1.3 retval=1/(exp(-x(1))+0.27); else % 1.3<=x<inf retval=4/(3*sqrt(pi))*(x(1)^2+pi^2/6)^(3/4); endif endfunction octsux(10) ## end And type 'usux' at octave's prompt Ben ;-) |
[Prev in Thread] | Current Thread | [Next in Thread] |