Im having trouble finding the mean of a row

I typed in tand(mean(matrix_name,5)).*120 because i need the mean of the rows of the matrix using a nested function and recieved a 5x3 matrix instead of the 1x5 matrix i was expecting. matrix_name is a 5x3 matrix. What am i doing wrong?

답변 (1개)

Roger Stafford
Roger Stafford 2015년 2월 10일
편집: Roger Stafford 2015년 2월 10일

1 개 추천

Given that matrix_name is 5-by-3,
tand(mean(matrix_name,2)).*120
will produce a 5-by-1 matrix, not a 1-by-5. The '2' would indicate that the mean is to be taken along the second dimension, namely over the three columns of each row. I don't know what you intended with the '5', but apparently matlab just ignored it.

댓글 수: 1

Thanks so much for the help. It worked this way but ill just make the calculation tand(mean(ScaledAngles,2)').*120 to get it to my desired format.

이 질문은 마감되었습니다.

제품

질문:

2015년 2월 10일

마감:

2021년 8월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by