Dear Julia users, I am getting the following error when I try to multiply some coefficients contained in my matrix Data G by the values in another matrix P. The code is the following one:
while bd>dualitygap
q=0;
for i in 1:ngen
for j in 1:T
## Cases with Popt
Popt[i,j]=(Lambda[j]-DataG[i,5])/2*DataG[i,4]
if Popt[i,j]<=DataG[i,2]
P[i,j]=DataG[i,2]
elseif (Popt[i,j]>=DataG[i,2] && Popt[i,j]<DataG[i,3])
P[i,j]=Popt[i,j];
posibles[i,j]=1
elseif Popt[i,j]>=DataG[i,3]
P[i,j]=DataG[i,3]
end
## Dynamic Programming
F[i,j]=DataG[i,(4:6)]*[P[i,j]^2;P[i,j];1]-Lambda[j]*P[i,j]
if F[i,j]<0
U[i,j]=1
else
U[i,j]=0
end
end
end >DimensionMismatch("Cannot multiply two vectors")
U
.
.
.
Note
[P[1,1]^2,P[1,1],1]
3-element Array{Float64,1}:
10000.0
100.0
1.0
DatosG[1,(4:6)]
3-element Array{Float64,1}:
0.002
10.0
500.0