calculating average value for matrix

39 vues (au cours des 30 derniers jours)
kash
kash le 6 Fév 2012
Modifié(e) : Junaid Qadir le 24 Avr 2018
I have a matrix of size 50x3
i want to find the average for each value by calculating recall and precision
is it possible,if so what are all the variables needed
please help

Réponse acceptée

Andrei Bobrov
Andrei Bobrov le 7 Fév 2012
out = abs(A-B)./A

Plus de réponses (3)

BHANESH BHADRECHA
BHANESH BHADRECHA le 7 Sep 2015
% suppose name of the matrix is 'm'
[a,b]=size(m);
s=sum(m); % sum of all columns
total=sum(s); % total sum
avg=total/(a*b);
  2 commentaires
BHANESH BHADRECHA
BHANESH BHADRECHA le 7 Sep 2015
Modifié(e) : BHANESH BHADRECHA le 7 Sep 2015
example let
m =
1 2 3
4 5 6
7 8 9
[a,b]=size(m) will give a=3 and b=3,
now s=sum(m) will be s= 12 15 18
total = 12+15+18 = 45
avg= 45/9 = 5
Walter Roberson
Walter Roberson le 7 Sep 2015
For the operation you are doing, mean2(m) does everything. This operation is, though, not what the Question is asking about, which is about Recall and Precision

Connectez-vous pour commenter.


Aravin
Aravin le 7 Fév 2012
mean of each value can't be calculated but you can get average of each column or row.
mean(M,1) % mean of each column
mean(M,2) % mean of each row
but to get precision and recall. You have to provide more information. Like precision in what and recall of what ?
  1 commentaire
kash
kash le 7 Fév 2012
I have two matrices of 50x3,A and B
A is the original matrix
B is the matrix after performing some operation
now i sit possible to calculate precision and recall for B matrix,the accuracy for each value

Connectez-vous pour commenter.


Junaid Qadir
Junaid Qadir le 24 Avr 2018
Modifié(e) : Junaid Qadir le 24 Avr 2018
clc
close all
clear all
N=9;
M=5;
Accum=zeros(M,1);
for i= 1:N
x=i+1;
%x= randn(M,1);
Accum= Accum+x;
end
Avg= Accum/N;

Catégories

En savoir plus sur Sparse Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by