How do I call a specific row in a table of data
조회 수: 13 (최근 30일)
이전 댓글 표시
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:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/789260/image.jpeg)
heres the table imported into mat lab for reference:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/789265/image.jpeg)
댓글 수: 0
채택된 답변
Chunru
2021년 11월 4일
% dummy data
x = randn(7, 5)
% 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)
% squared average of average (not sure your exact meaning here)
y = mean(xave).^2
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Tables에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!