Info

この質問は閉じられています。 編集または回答するには再度開いてください。

If you are given an array with 3 different columns, how would you find the average of the 2nd column?

2 ビュー (過去 30 日間)
Dustin
Dustin 2014 年 6 月 23 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
the first column represents years, 2nd is cases, 3rd is infection rate. how to find average # of cases?

回答 (1 件)

Image Analyst
Image Analyst 2014 年 6 月 23 日
meanCases = mean(theArray(:, 2));
  2 件のコメント
Dustin
Dustin 2014 年 6 月 23 日
would that be the same thing as meanCases = mean(cases(:,2));
???
Image Analyst
Image Analyst 2014 年 6 月 23 日
Yes if your N row by 3 column array is called "cases". I didn't think it would be because cases was only the second column, with the other columns meaning different things , so I didn't think you'd call the whole array cases so that's why I called it theArray.

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by