hi-i have a one dimensional for loop and i need to change it to different dimensional?
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
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
Respuestas (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 comentario
Mary
el 13 de Jul. de 2015
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!