|
From: | Nicholas Jankowski |
Subject: | Re: help please |
Date: | Wed, 29 Jul 2015 10:22:36 -0400 |
I have a file that has 11 columns, these columns I'm interested 3 (actually
2, the third helps me to compare rows) so I need the third column that
prints compare the ranks. So divided into groups the other two columns where
the row of the third column are equal. I apply:
f = fopen('prueba.224');
d = textscan(f,'%*d %*s %*d %*d %*d %d %*d %*d %*d %d %f ');
fclose(f);
elv=d(1);
dif=d(2);
t=d(3);
i=1;
j=1;
ii=length(t);
while i<ii
Eq(i)=find(t==t(i));
L=length(Eq);
pesos(j)=(sin(elv(Eq(i))))^2;
x1(j)=sum(dif(Eq(i))*pesos(j))/sum(pesos);
i=i+L;
i=i+L;
j=j+1;
end
File example:
<nabble_img
src=""> border="0" class="center"/>
my goal is, from the last column split the data into groups of rows where
these coincide in the last column, and then these groups want to get two
columns of concrete that if I can do as I put in command previous.
But the code has failures and I do not know what failures are..
[Prev in Thread] | Current Thread | [Next in Thread] |