sum matrixs after loading
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Hi all,
I know it's a noob question and I'm sorry for that but I cannot figure it out.
This is my code:
V_I1=load('Vdef1.txt', 'V_I', '-ascii');
V_I2=load('Vdef2.txt', 'V_I', '-ascii');
V_I3=load('Vdef3.txt', 'V_I', '-ascii');
V_I4=load('Vdef4.txt', 'V_I', '-ascii');
V_I5=load('Vdef5.txt', 'V_I', '-ascii');
V_I6=load('Vdef6.txt', 'V_I', '-ascii');
V_I7=load('Vdef7.txt', 'V_I', '-ascii');
V_I8=load('Vdef8.txt', 'V_I', '-ascii');
V_I9=load('Vdef9.txt', 'V_I', '-ascii');
V_I10=load('Vdef10.txt', 'V_I', '-ascii');
for l=1:nelettrodi
for j=l+1:nelettrodi
for k=j+1:nelettrodi
V_= V_I(l)+V_I(j)+V_I(k);
I'd like V_I(j), for j=1 for example, to be the matrix V_I1 I previously loaded ( and so on for the other indexes). This way also V_ is a matrix that is the sum of the others. I searched around but I wasn't able to find the solution to this. Thanks for your help, Giorgio.
0 comentarios
Respuestas (1)
Walter Roberson
el 23 de Jul. de 2012
2 comentarios
Giorgio Scolozzi
el 24 de Jul. de 2012
Editada: Giorgio Scolozzi
el 24 de Jul. de 2012
Walter Roberson
el 24 de Jul. de 2012
for i=1:10
V_I{i} = load(['Vdef',num2str(i),'.txt'], '-ascii');
end
Then
V_{i} = V_I{l} + V_I{j} + V_I{k};
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!