summaryrefslogtreecommitdiff
path: root/macros/wrev.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/wrev.sci')
-rw-r--r--macros/wrev.sci23
1 files changed, 23 insertions, 0 deletions
diff --git a/macros/wrev.sci b/macros/wrev.sci
new file mode 100644
index 0000000..a01ed77
--- /dev/null
+++ b/macros/wrev.sci
@@ -0,0 +1,23 @@
+function [y]= wrev(x)
+
+// Reverses order of elements of input vector
+// Calling Sequence
+// [y]=wrev(x)
+// Parameters
+// x: Input vector of string, real or complex values
+// Description
+// This is an Octave function.
+// This function reverses the order of elements of the input vector x.
+// Examples
+// 1. wrev([1 2 3])
+// ans= 3 2 1
+// 2. wrev(['a','b','c'])
+// ans= cba
+
+funcprot(0);
+rhs=argn(2);
+if (rhs~=1) then
+ error("Wrong number of input arguments.")
+else y=callOctave("wrev",x)
+end
+endfunction