Home > Net >  Octave / Gradient Descent code: GD works fine, but it won't save the output from the cost funct
Octave / Gradient Descent code: GD works fine, but it won't save the output from the cost funct

Time:06-21

The Gradient Descent part of this code works fine, but can anyone tell me why it's not initialising (or populating) the vector 'J_history'?

Here's the principal code:

data = load('ex1data1.txt'); %2 columns of data - a single x variable and a single y
X = [ones(m, 1), data(:,1)];            
  • Related