How to create an double for loop in matlab?
Mostrar comentarios más antiguos
Hi, I want to create a double loop where one loop would go across each matrix and the second loop would go through the individual matrix. For example, I have 4 matrices in list names A through D and within each of these matrices are 5 variables. The following code would generate 4 matrices and within each consists of five variables.
A = rand(100,5);
B = rand(100,5);
C = rand(100,5);
D = rand(100,5);
%
% To create a double loop
for i = 1:size(A,2)-1
for j = A:D
Tables.Table{j}(:,1) = corr({j}(:,1), {j}(:,i+1));
end
end
Can somebody please guide me on this?
Thank you very much for your time and consideration.
Yahya
Respuestas (1)
dpb
el 5 de Jun. de 2017
0 votos
"I have 4 matrices in list names A through D..."
Categorías
Más información sobre Loops and Conditional Statements en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!