summaryrefslogtreecommitdiff
path: root/demos/Abhinav_Demos/nan_median.sci
diff options
context:
space:
mode:
Diffstat (limited to 'demos/Abhinav_Demos/nan_median.sci')
-rw-r--r--demos/Abhinav_Demos/nan_median.sci31
1 files changed, 31 insertions, 0 deletions
diff --git a/demos/Abhinav_Demos/nan_median.sci b/demos/Abhinav_Demos/nan_median.sci
new file mode 100644
index 0000000..f2b350c
--- /dev/null
+++ b/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
+