hi-i have a one dimensional for loop and i need to change it to different dimensional?
Infos
Cette question est clôturée. Rouvrir pour modifier ou répondre.
Afficher commentaires plus anciens
hi-i have a one dimensional for loop and I need to change it to different dimensional?
T=33; size EG is =786432*1;size KNM is 786432*33
Conter_EG=size(EG,1);
Co=zeros(Conter_EG);
for NM=1:Conter_EG
R_KNM=KNM(NM);
Co(NM)=GT_New(R_KNM);
end
Please can anyone tell me how to change the for loop - i am new in coding -many thanks
Réponses (1)
If GT_New is defined to process 1X33 input, you replace the four line with
R_KNM=KNM(NM,:);
If you do not need R_KNM elsewhere, you can also replace the two lines in the for loop with a single one:
Co(NM)=GT_New(KNM(NM,:));
1 commentaire
Mary
le 13 Juil 2015
Cette question est clôturée.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!