Hi
I want to save results of calculation in an emty struct(3*3*2 with fields:cost)named "mymax".
"stwhole" (3*3*2 with field:cost) at the following code is the name of my original struct. in each field of stwhole that is named cost are two values. and I want to multiply them (these two values of each field) to elements of matrix A separately then find the max of them and save it to corresponding fields in struct "mymax". the size of matrix A is 1*9.
this code doesn't work correctly.PLEASE HELP MEif true empty_max.cost=[]mymax=repmat(empty_max,[3,3,2])for iteration:1:9for k=1:9mymax(k).cost=[]for i=1:3for j=1:3for m=1:2ops=(stwhole(i,j,m).cost).*A(K)ty=max(ops)mymax(k).cost=[ty]endendendendend
Best Answer