Im having trouble finding the mean of a row
Info
This question is closed. Reopen it to edit or answer.
Show older comments
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?
Answers (1)
Roger Stafford
on 10 Feb 2015
Edited: Roger Stafford
on 10 Feb 2015
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 Comment
Dominick Goodwin
on 10 Feb 2015
This question is closed.
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!