Code to determine a log of the mean for a column of numbers?

조회 수: 4 (최근 30일)
Gregor Massie
Gregor Massie 2022년 8월 5일
댓글: Walter Roberson 2022년 8월 8일
I actually could do with code to produce the following -I have a dataset and need a results table presenting the log of the mean, maximum and average for four different columns of numbers. So for column 1 - log of the mean, 2 - maximum, 3 - average, 4 - average.
  댓글 수: 4
dpb
dpb 2022년 8월 5일
"for four different columns of numbers..."
So there are 4xN values total or just N?
And, what is
"for column 1 - log of the mean, 2 - maximum, 3 - average, 4 - average."
the duplicate of the last two intended to be?
Gregor Massie
Gregor Massie 2022년 8월 8일
the duplicate is just another indice that we require the average for

댓글을 달려면 로그인하십시오.

답변 (1개)

Les Beckham
Les Beckham 2022년 8월 5일
A = magic(4)
A = 4×4
16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
logmean_col1 = log(mean(A(:,1)))
logmean_col1 = 2.1401
max_col2 = max(A(:,2))
max_col2 = 14
mean_col3 = mean(A(:,3))
mean_col3 = 8.5000
mean_col4 = mean(A(:,4))
mean_col4 = 8.5000
  댓글 수: 3
Gregor Massie
Gregor Massie 2022년 8월 8일
편집: Gregor Massie 2022년 8월 8일
Thanks guys, thats great! I'm now looking for code to calculate the anitlog for the first column of numbers? I actually missed out this step, for the first column we calculatye the antilog for each number then work out the log of the mean for the whole column
Walter Roberson
Walter Roberson 2022년 8월 8일
exp() for the antilog

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by