I keep struggling to correct this error in my code “DimensionMismatch(“tried to assign 15-element array to 1×5 destination”)”. I kindly need help to correct this code to get it running correctly please. Thank you. My code is attached
a1=[0, 2.5, -2.5, 2, -2.5] # x cordinates of the circle
b1=[0, 0.3, 0.25, -2.5, -2.25] # y cordinates of the circle
r1= [2, 2 , 2 , 2 ,2] # Radiuus of circle
A=[1 0 0 0 1;0 0 0 1 1;1 0 0 0 1;0 0 1 1 1;0 0 0 1 1; 0 1 0 0 1;0 0 1 1 0;0 0 0 1 0;
1 0 0 0 0;1 1 0 0 0;0 1 0 0 0;0 0 1 0 0;0 0 1 0 0;1 0 0 0 0;0 0 0 1 0 ]
m,n=size(A)
CoveredItems=zeros(Int64,m)
Coverage=zeros(Int64,n)
for i in 1:n
sumval=sum(A[:,i])
Coverage[i]=sumval
end
SelectedSolution=zeros(Int64,n)
maxval,maxpos=findmax(Coverage)
CoveredItems=A[:,maxpos]
SelectedSolution[maxpos]=1
count=maxval
println(maxpos)
UncoveredItems=zeros(Int64,m)
for i in 1:m
if (CoveredItems[i]==0)
UncoveredItems[i]=1
else
A[i,:]=zeros(Int64,m)
end
end
print(A)