私のコードは以下のとおりです。このエラーが発生します。
The expression to the left of the equals sign is not a valid target for an assignment.
を指すTemp1(i) = ( ( X(i,1)*theta(i,1) + X(i,2)*theta(i,2) ) - y(i));
ここで何が悪いのかわかりません。助けてください
Temp1 = zeros(m);
sum1 = 0;
for i = 1:1:m
{
Temp1(i) = ( ( X(i,1)*theta(i,1) + X(i,2)*theta(i,2) ) - y(i));
sum1 = sum1 + (Temp1(i)^2);
}
J = sum1 / (2*m);
fprintf(' The value of J = ');
fprintf('%f', J);
return J;