Finding the mean of a matrix row? Get error "Subscript indices must either be real positive integers or logicals."
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Mischa Kim
il 9 Mar 2014
Modificato: Mischa Kim
il 9 Mar 2014
Use
A = mean(Xtcounter,2)
B = std(Xtcounter,0,2)
C = kurtosis(Xtcounter')'
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Logical in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!