sum matrixs after loading
Show older comments
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.
Answers (1)
Walter Roberson
on 23 Jul 2012
1 vote
2 Comments
Giorgio Scolozzi
on 24 Jul 2012
Edited: Giorgio Scolozzi
on 24 Jul 2012
Walter Roberson
on 24 Jul 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};
Categories
Find more on Just for fun in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!