This is my implementation of `CostFunctionJ`

:

```
function J = CostFunctionJ(X,y,theta)
m = size(X,1);
predictions = X*theta;
sqrErrors =(predictions - y).^2;
J = 1/(2*m)* sum(sqrErrors);
```

But when I try to enter the command in MATLAB as:

```
>> X = [1 1; 1 2; 1 3];
>> y = [1; 2; 3];
>> theta = [0,1];
>> J = CostFunctionJ(X,y,theta)
```

It gives me the following error:

```
Error using *
Inner matrix dimensions must agree.
Error in CostFunctionJ (line 4)
predictions = X*theta;
```