projects
/
scilab.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
* Bug 16365 fixed: median(m,'r'|'c') was wrong after 5dc990
[scilab.git]
/
scilab
/
modules
/
statistics
/
macros
/
median.sci
diff --git
a/scilab/modules/statistics/macros/median.sci
b/scilab/modules/statistics/macros/median.sci
index
d003790
..
6bd1e64
100644
(file)
--- a/
scilab/modules/statistics/macros/median.sci
+++ b/
scilab/modules/statistics/macros/median.sci
@@
-99,7
+99,7
@@
function y = median(x,orient)
n = xsize(orient)
for k = 1:N
for i = 1:M
- ytemp = gsort(x(i+(0:n-1)*M+(k-1)*P),"r","i")
+ ytemp = gsort(x(i+(0:n-1)'*M+(k-1)*P),"r","i")
if 2*int(n/2)==n then
// avoid overflow: http://bugzilla.scilab.org/14640
a = ytemp(n/2)