Hi friends, I have an optimization model that I am going to get the optimal answer with the genetic algorithm, one of our cost semesters is as follows:
Cost of transporting packs from warehouses to tents: ∑∑∑ 𝐶𝐵(n, j, k) 𝑃𝐵(n, j, k). Which I wrote in MATLAB as follows :
pop(it,np).cost.term3=pop(it,np).cost.term3+pop(it,np).arthvar.PB(n,j,k). *CB(n,j,k);
Now the problem is that MATLAB gives this error. While the dimensions of the matrix are the same and when I turn.* to * again, it gives an error, while when I copy my matrix in the Command Window and execute this loop, it resolves without any error while it is not in the code.