フィルターのクリア

How do I average the columns for the respective rows to draw a graph?

3 ビュー (過去 30 日間)
Lakyn
Lakyn 2016 年 8 月 11 日
コメント済み: Star Strider 2016 年 8 月 11 日
Hi!
So right now I have a data set of 76x2000, so thats 76 rows with 2000 data each. I want to average those 2000 data, and get a single value for each of the 76 rows.
After this, I want to graph those single values as the y-axis, and x-axis as 1-76 "units".
Thank you very much for your help!

採用された回答

Star Strider
Star Strider 2016 年 8 月 11 日
This works:
M = randi(99, 76, 2000); % Create Matrix
RowMean = mean(M,2);
x = 1:size(M,1);
figure(1)
plot(x, RowMean)
grid
  2 件のコメント
Lakyn
Lakyn 2016 年 8 月 11 日
編集済み: Lakyn 2016 年 8 月 11 日
Hi! thanks for the reply, in this case, is M the data set? and do I just write that as a function? I already have A = 76x2000 data in my workspace. Thanks!
Star Strider
Star Strider 2016 年 8 月 11 日
My pleasure!
In my code, ‘M’ is your data matrix. You just include the code I wrote in your script, wherever you want it, after assigning ‘A’.
If ‘A’ is your data matrix, my code becomes:
RowMean = mean(A,2);
x = 1:size(A,1);
figure(1)
plot(x, RowMean)
grid

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDirected Graphs についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by