sum matrixs after loading
Afficher commentaires plus anciens
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.
Réponses (1)
Walter Roberson
le 23 Juil 2012
1 vote
2 commentaires
Giorgio Scolozzi
le 24 Juil 2012
Modifié(e) : Giorgio Scolozzi
le 24 Juil 2012
Walter Roberson
le 24 Juil 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};
Catégories
En savoir plus sur Just for fun dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!