How i can program the following metrics in MATLAB
4 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
zahid
le 22 Fév 2016
Modifié(e) : Roger Stafford
le 23 Fév 2016
Dear all
With due respect i need to programme my problem where i need to calculate some following quantities.I do not know how i can programme this in matlab.Suppose the following matrix is given.

Now i need to calculate the following measures for this matrix

This formula calculate medians of absolute values of each column of the matrix X.The second measure is following

How i can program this in matalb.Total values for Pj will be n(i.e the number of rows) and total value of Ti will be k(i.e the number of columns).For simplicity we can define the matrix X =[1,5,3;7,2,-2;4,4,-2];Actually the value X in my problem is big but for simplicity i have taken this small data for understanding purpose.
Thanks
0 commentaires
Réponse acceptée
Roger Stafford
le 22 Fév 2016
Modifié(e) : Roger Stafford
le 23 Fév 2016
In the definition of P(j) you have j varying from 1 to n, and therefore j should be the first (row) index of X, X(j,i), and not X(i,j). Assuming that to be true, do this:
T = median(abs(X),1);
P = sum(max(repmat(T,n,1),abs(X)),2);
The T result should be a row vector of length k and the P result a column vector of length n.
Read these:
http://www.mathworks.com/help/matlab/ref/median.html
http://www.mathworks.com/help/matlab/ref/max.html
http://www.mathworks.com/help/matlab/ref/sum.html
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Numeric Types dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!