I have a "file1" with the variables P1, T1, C1 (the variables size can change from 1x1 to 1x30) and "file2" with P2, T2, C2 (they are standard values, always the variables size is 1x20). I need to calculate x=C1-C2 e.g, I need that matlab search which value of C2 it should use when P1==P2 & T1==T2. They are always values of T1=T2 and P1=P2.
What I am doing is loading both files to bring all the variables to my work space and then:
ind=find(T1==T2(ll) & P1==P2(ll));
Error: Index exceeds matrix dimensions. Error in Excel_table (line 63) km_eq(ind(i))= km(ll);
And : Always the first values of C3 is zero, it doesn't matter if the size of the variables is 1x2, or 1x10.
I don't have so much experience Matlabing, any suggestion about how to approach the problem is welcome.
Thanks in advance.