필터 지우기
필터 지우기

How do I call a specific row in a table of data

조회 수: 13 (최근 30일)
JMK
JMK 2021년 11월 4일
댓글: JMK 2021년 11월 4일
I have a table of data and there is 5 rows and 5 columns, Im wondering what is the way to correctly call one row of the table and then find the average of each row, and then square root the average time of each row.
here what I mean: I need to use a command to call out an indivual row, then I need to find the average of the row's value. then find the squared average of those averaged values.
here is the table for reference:
heres the table imported into mat lab for reference:

채택된 답변

Chunru
Chunru 2021년 11월 4일
% dummy data
x = randn(7, 5)
x = 7×5
0.6502 -1.3941 2.3902 -0.1460 -1.9208 1.9957 -0.6656 -0.4266 0.7290 0.5461 1.2666 0.4532 1.0042 0.0764 0.8513 0.9760 -0.7714 -0.8409 0.3690 -1.3566 -0.5684 -1.0316 0.8156 0.4102 0.3727 -0.1912 -1.3393 -0.9203 0.6698 1.1634 -0.9529 0.2073 -1.4404 0.5985 -0.1304
% In your data, 1st column is distance. You should ignore it for
% averaging.
xave = mean(x(:, 2:end), 2) % select all rows and 2nd to last columns, then average along rows (2)
xave = 7×1
-0.2677 0.0457 0.5963 -0.6500 0.1417 -0.1066 -0.1912
% squared average of average (not sure your exact meaning here)
y = mean(xave).^2
y = 0.0038
  댓글 수: 2
JMK
JMK 2021년 11월 4일
thank you for the assitance
JMK
JMK 2021년 11월 4일
but what i meant by this is a need to find the square root of the averages, I believe thats what it is asking

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

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by