Finding the mean of a matrix row? Get error "Subscript indices must either be real positive integers or logicals."
1 次查看(过去 30 天)
显示 更早的评论
If I have the following matrix as an output from my code;
Xtcounter =
0 4 4 4 0
0 4 4 4 0
0 4 4 4 0
0 4 4 4 0
3 4 4 1 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
2 4 4 2 0
where each row represents particle's positions along the axis at a time.
I want to find the mean value of each row but it wont let me, I have tried various methods such as
A=Xtcounter(2,:) M=mean(A)
but get the error message;
Subscript indices must either be real positive integers or logicals.
If anyone could help it would be so appreciated!! As i will need to be able to do standard deviation, kurtosis and skewness of each row after!
Thanks in advance!!
0 个评论
采纳的回答
Mischa Kim
2014-3-9
编辑:Mischa Kim
2014-3-9
Use
A = mean(Xtcounter,2)
B = std(Xtcounter,0,2)
C = kurtosis(Xtcounter')'
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!