Hello everyone,
I have an optimization variable
y=optimvar('y',[4,1],'Type','integer','LowerBound',0,'UpperBound',1);
and I want to put this "y" into a matrix which have 4 time periods, so i created a multidimensional matrix as this:
yi=y([ 1 2 3 4; 2 2 3 4;3 3 3 4;4 4 4 4]);yi(:,:,2)= y([ 1 2 3 4; 2 2 3 4;3 3 3 4;4 4 4 4]);yi(:,:,3)= y([ 1 2 3 4; 2 2 3 4;3 3 3 4;4 4 4 4]);yi(:,:,4)= y([ 1 2 3 4; 2 2 3 4;3 3 3 4;4 4 4 4]);
where the third dimension is about time, which I have 4 years in my problem. While I run this code in matlab it says this is an illegal assignment, could anyone help me with that?
Thank you!
Best Answer