フィルターのクリア

How to rectify this error,

1 回表示 (過去 30 日間)
Reetu Singh
Reetu Singh 2019 年 4 月 24 日
コメント済み: Reetu Singh 2019 年 4 月 24 日
Not enough input arguments.
Error in computeCost (line 3)
m = size(age,1);
the code is given below
function [J,grad] = computeCost(Theta,age,chol)
m = size(age,1);
age = [ones(m,1) age];
h = sigmoid(age * Theta);
J= -(1/m)*sum(y .* log(h) + (1-chol) .* log(1-h));
grad = zeros(size(Theta,1) ,1);
for i=1:size(grad),
grad(i)=(1/m)*sum( (h-chol)' * age(:,i));
end

採用された回答

KSSV
KSSV 2019 年 4 月 24 日
Don't run the function usinf run/ F5. Give inputs and call it.
Theta = pi ;
age = 30. ;
chol = rand ;
[J,grad] = computeCost(Theta,age,chol) ;
  1 件のコメント
Reetu Singh
Reetu Singh 2019 年 4 月 24 日
okay...Thank you so much.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

タグ

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by