how to select values from matrix?

1 view (last 30 days)
Mitali Oraw
Mitali Oraw on 25 Oct 2013
Edited: Andrei Bobrov on 25 Oct 2013
I have 10 cores C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,, each core have their own testing time,, I represent the testing time of each core by matrix A where each row corresponds to core no.
A = [ 428,220,155,116,103,90,77,64,64,63,51,51,51,51,50,38;
15292,7719,4067,3175,2655,2070,1774,1624,1405,1257,1182,1107,1034,960,886,813;
5058,2582,2507,2507,2507,2507,2507,2507,2507,2507,2507,2507,2507,2507,2507,2507;
26602,13354,11129,6782,5829,5829,5829,5829,5829,5829,5829,5829,5829,5829,5829,5829;
191874,95992,64070,48106,38481,32167,27613,24163,21518,19757,17624,16194,14983,14873,14873,12192;
185794,93014,62248,46741,37364,31241,28199,23488,20906,19034,19034,18799,18799,18564,18564,11978;
65686,32891,21959,16493,13243,11027,9695,8342,7383,6717,6431,6431,6431,6431,6431,4219;
22427,11262,8721,5680,4605,4605,4605,4605,4605,4605,4605,4605,4605,4605,4605,4605;
26351,13182,8802,6597,5310,4440,3798,3305,2964,2820,2418,2226,2118,2118,2118,1659;
120188,60128,40137,30132,24701,21182,17663,15100,14144,14144,11033,10625,10625,10625,10625,7586 ] ;
And also I have represent all the core by matrix Z
Z=[6,10,5,4;7,8,3,0;1,2,9,0];
each element in matrix Z correspond to the no of rows of matrix A. I have generate a temporary matrix temp which always produce random number and summation of each element in a must not be greater than 16. the code is
highest_num=14;
n=randperm(14);
c=combnk(n,3);
t=1;
for i=1:((highest_num*(highest_num-1)*(highest_num-2))/(3*2*1))
sum=0;
for j=1:3
sum=sum+c(i,j);
end
if(sum==16)
m=1;
for k=1:3
if(m<4)
temp(t,k)=c(i,m);
m=m+1;
end
end
t=t+1;
end
end
suppose temp matrix is
temp =[ 9 6 1 ; 9 2 5 ; 9 4 3 ; 6 2 8 ; 6 7 3 ; 1 2 13 ; 1 8 7 ; 1 12 3 ;1 5 10 ; 1 4 11 ; 2 4 10 ; 2 3 11 ; 8 5 3 ; 5 4 7]
I have to pick values from matrix A according to mapping between matrix Z and matrix temp,, I want to say that the 1st element of 1st row and 1st column of temp is 9 and the 1st element of 1st row and 1st column of Z is 6 so i have to pick the value of row no 6 and colum no 9 from matrix A afterthat the element of 2nd row and 1st column of Z is 7 so i have pick value of row no 7 and col no 9 from matrix A, afterthat the element of 3rd row and 1st column of Z is 1 so i have pick value of row no 1 and col no 9 from matrix A,, then i have to do summation of of these trhee values,,likewise I have to pick values from A for 2nd column and 3rd column of Z and temp and calculate the summation of 2nd column and 3rd column.. the total_testingTime is the maximum among three summation.
Now i have apply simulated annealing for selecting the best total_testingTime so the above technique has to be done until temperature>1 the initial temperature = 100 and the cooling_rate = 5
so can u please me suggest me to perform this code in matlab

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!