summaryrefslogtreecommitdiff
path: root/2.3-1/demos/Abhinav_Demos/non_zero.sci
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/demos/Abhinav_Demos/non_zero.sci')
-rw-r--r--2.3-1/demos/Abhinav_Demos/non_zero.sci15
1 files changed, 15 insertions, 0 deletions
diff --git a/2.3-1/demos/Abhinav_Demos/non_zero.sci b/2.3-1/demos/Abhinav_Demos/non_zero.sci
new file mode 100644
index 00000000..3e2b3ba9
--- /dev/null
+++ b/2.3-1/demos/Abhinav_Demos/non_zero.sci
@@ -0,0 +1,15 @@
+
+// Test file for "nonzero" function for the data types double, float, double complex, uint16
+
+function non_zero()
+ a=[12,4,4; 12,51,6] // double array
+ disp(nnz(a))
+ b=0 //double scalar
+ disp(nnz(b))
+ f= float(a) //float array
+ disp(nnz(f))
+ z=%i*2+0 // doubleComplex scalar
+ disp(nnz(z))
+
+
+endfunction