summaryrefslogtreecommitdiff
path: root/2.3-1/demos/Abhinav_Demos/nan_median.sci
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/demos/Abhinav_Demos/nan_median.sci')
-rw-r--r--2.3-1/demos/Abhinav_Demos/nan_median.sci31
1 files changed, 31 insertions, 0 deletions
diff --git a/2.3-1/demos/Abhinav_Demos/nan_median.sci b/2.3-1/demos/Abhinav_Demos/nan_median.sci
new file mode 100644
index 00000000..f2b350c0
--- /dev/null
+++ b/2.3-1/demos/Abhinav_Demos/nan_median.sci
@@ -0,0 +1,31 @@
+function nan_median()
+
+x=[%nan 0.121 %nan 0.5 0.8; 0.12 %nan 1 0.9812 %nan; 0.4 0.65 1.08 12 0.1621; 12 12 24 1 12]
+
+disp('Double')
+
+disp(nanmedian(x))
+disp('')
+
+disp(nanmedian(x , 'r'))
+disp('')
+
+disp(nanmedian(x, 'c'))
+disp('')
+
+y= float(x)
+
+disp('Float')
+
+disp(nanmedian(y))
+disp('')
+
+disp(nanmedian(y , 'r'))
+disp('')
+
+disp(nanmedian(y, 'c'))
+disp('')
+
+
+endfunction
+