calculating average value for matrix
조회 수: 27 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
추가 답변 (3개)
BHANESH BHADRECHA
2015년 9월 7일
% 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
BHANESH BHADRECHA
2015년 9월 7일
편집: BHANESH BHADRECHA
2015년 9월 7일
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
2015년 9월 7일
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
Aravin
2012년 2월 7일
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 ?
Junaid Qadir
2018년 4월 24일
편집: Junaid Qadir
2018년 4월 24일
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;
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!