フィルターのクリア

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!!

採用された回答

Mischa Kim
Mischa Kim 2014 年 3 月 9 日
編集済み: Mischa Kim 2014 年 3 月 9 日
Use
A = mean(Xtcounter,2)
B = std(Xtcounter,0,2)
C = kurtosis(Xtcounter')'

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by