finding the computation for n columns

3 vues (au cours des 30 derniers jours)
Tino
Tino le 14 Mai 2019
Modifié(e) : madhan ravi le 15 Mai 2019
Hi
Given a a vector table z with column and row of 1200 and 1200 respectively
I want to compute the following for each rows
z = ( T R S T V............n column)
first column T
K = 3;
c1 = sort(T.distance(1:2:end));
c2 = sort(T.distance(2:2:end));
s1 = sum(c1(1:K))/sum(c2(1:K )) ;
second column R
K = 3;
c1 = sort(R.distance(1:2:end));
c2 = sort(R.distance(2:2:end));
s2 = sum(c1(1:K))/sum(c2(1:K )) ;
disp(s2);
How do I make this computation using a small code for n columns
Thank you in advance
Tino

Réponses (1)

madhan ravi
madhan ravi le 14 Mai 2019
Modifié(e) : madhan ravi le 14 Mai 2019
Z=z{:,:};
K = 3;
c1 = sort(Z(1:2:end,:));
c2 = sort(Z(2:2:end,:));
s1 = sum(c1(1:K,:))./sum(c2(1:K,:))
  11 commentaires
Tino
Tino le 15 Mai 2019
Hi Madhan
Can you see the data now?
Thanks
tino
madhan ravi
madhan ravi le 15 Mai 2019
Modifié(e) : madhan ravi le 15 Mai 2019
No , I am not able to , there‘s some problem downloading files in my mac.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Communications Toolbox dans Help Center et File Exchange

Tags

Produits


Version

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by