> I'm a new user of octave and i'm getting an error while trying to use a
> function. I've checked the forum for similar error. Even though the error in
> my case is same, i'm pretty sure it is not a formatting error and I've
> written the code in OctaveGUI.
> octave:9> val = costFunc(x,y,theta)
> error: 'costFunc' undefined near line 1 column 7
> Here is my code
> function j=costFunc(x,y,theta)
Did you save "costFunc" as m-file "costFunc.m" in the current working
directory? You can assure this by typing
ans = /home/siko1056/work
>> which costFunc
'costFunc' is a function from the file /home/siko1056/work/costFunc.m
Then you have to define x, y, and theta and can call "costFunc" as you
have done before.