ptions = optimset('GradObj', 'on', 'MaxIter', '100'); initialTheta = zeros(2,1); [optTheta, functionVal, exitFlag] = fminunc(@costFunction, initialTheta, options); 1 2 3 fminunc表示Octave里无约束最小化函数,调用这个函数时,需要传入一个存有配置信息的变量options.上面的代码中,我们的设置项中’GradObj’,…