[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Octave function error
From: |
Adrg01 |
Subject: |
Octave function error |
Date: |
Mon, 30 Mar 2020 01:23:45 -0500 (CDT) |
Hi
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
<https://octave.1599824.n4.nabble.com/file/t373708/func.png>
function j=costFunc(x,y,theta)
m=length(theta)+1
yPred=(theta')*x
temp=(yPred-y).*(yPred-y)
j=(1/2*m)*(sum(temp));
endfunction
--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
- Octave function error,
Adrg01 <=