diff options
Diffstat (limited to 'macros')
-rw-r--r-- | macros/lib | 5 | ||||
-rw-r--r-- | macros/octave_fun.bin | bin | 0 -> 4262 bytes | |||
-rw-r--r-- | macros/octave_fun.sci | 63 | ||||
-rw-r--r-- | macros/scilab_error.bin | bin | 1951 -> 0 bytes | |||
-rw-r--r-- | macros/scilab_error.sci | 19 | ||||
-rw-r--r-- | macros/scilab_sum.bin | bin | 913 -> 0 bytes | |||
-rw-r--r-- | macros/scilab_sum.sci | 10 |
7 files changed, 65 insertions, 32 deletions
@@ -1,5 +1,4 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?> -<scilablib name="scilab_toolboxlib"> - <macro name="scilab_error" file="scilab_error.bin" md5="1d8333160de4df7b257ac6ce6a660fb4"/> - <macro name="scilab_sum" file="scilab_sum.bin" md5="1ca685054fd3e9159204826fc4f3b06a"/> +<scilablib name="scilab_octavelib"> + <macro name="octave_fun" file="octave_fun.bin" md5="1648c1471394ed99be43b78ba3ee3576"/> </scilablib> diff --git a/macros/octave_fun.bin b/macros/octave_fun.bin Binary files differnew file mode 100644 index 0000000..b1ab402 --- /dev/null +++ b/macros/octave_fun.bin diff --git a/macros/octave_fun.sci b/macros/octave_fun.sci new file mode 100644 index 0000000..84b374d --- /dev/null +++ b/macros/octave_fun.sci @@ -0,0 +1,63 @@ +function [y] = octave_fun() + // Calls an octave function with given inputs and returns the expected output + // + // Syntax + // [y1, y2, ...] = octave_fun("octave_function",input1,input2,...) + // [y1, y2, ...] = octave_fun("octave_function",input1,input2,...,optional_input1,optional_input2,...) + // [y1, y2, ...] = octave_fun("octave_function","octave_package",input1,input2,...) + // [y1, y2, ...] = octave_fun("octave_function","octave_package",input1,input2,...,optional_input1,optional_input2,...) + // + // Parameters + // y : ouput as returned by octave. It can be a vector or matrix of doubles + // octave_function : name of the function in octave that has to be called. It has to be a string in double quotes + // input : input as expected by the octave function. It can be a vector or matrix of doubles + // optional_input : an optional argument that the given octave function can accept. It has to be a string in double quotes + // octave_package : name of the package in octave that has to be loaded as required by the octave function. It has to be a string in double quotes + // + // Description + // This function accepts an octave function name with the relevant inputs and returns the output as generated. It requires Octave to be installed along with necessary packages. + // + // <latex> + // \begin{eqnarray} + // &\mbox{min}_{x} + // & C^T⋅x \\ + // & \text{subject to}& A⋅x = b \\ + // & & G⋅x \preceq_K h \\ + // & & x_i \in \{0,1\}, i \in \!\, bool_vars\ + // & & x_j \in \!\, \mathbb{Z}, i \in \!\, int_vars\\ + // \end{eqnarray} + // </latex> + // + // Examples + // // Finding the inverse of a matrix using octave + // A=[1 2 3;4 5 6;7 8 0] + // y = octave_fun("inv",A) + // y*A + // + // Examples + // + // // Finding the roots of a polynomial using its coefficients as inputs, using octave + // p = [1 2 3]; + // y = octave_fun("roots",p) + // + // Examples + // + // // Generating filter coefficients of a Hamming window of length M, using octave. + // M = 5 + // y = octave_fun("hamming",M) + // + // Examples + // + // // Generating filter coefficients of a Hamming window of length M with optional arguments, using octave. + // M = 5 + // y = octave_fun("hamming",M,"periodic") + // + // + // Examples + // + // // Generating an elliptic or Cauer filter with given passband ripple and stopband attenuation, using octave and its "signal" package. See help in octave for more information about "ellip" function + // [b, a]=octave_fun("ellip","signal",5,1,90,[0.1 0.2]) + // +// Authors +// Rupak Rokade +endfunction diff --git a/macros/scilab_error.bin b/macros/scilab_error.bin Binary files differdeleted file mode 100644 index 41c22ca..0000000 --- a/macros/scilab_error.bin +++ /dev/null diff --git a/macros/scilab_error.sci b/macros/scilab_error.sci deleted file mode 100644 index 24d1559..0000000 --- a/macros/scilab_error.sci +++ /dev/null @@ -1,19 +0,0 @@ -// ==================================================================== -// Template toolbox_skeleton -// This file is released under the 3-clause BSD license. See COPYING-BSD. -// ==================================================================== -// -// -function scilab_error(varargin) - - argSize = size(varargin); - - if argSize <> 1 then - error(msprintf(_("toolbox_skeleton", "%s: I''m waiting for only one argument.\n"), "scilab_error")); - end - - if argSize == 1 then - error(msprintf(gettext("toolbox_skeleton", "%s: Yeah! %d is a good number of arguments but I prefer fail, sorry.\n"), "scilab_error", 1)); - end -endfunction -// ==================================================================== diff --git a/macros/scilab_sum.bin b/macros/scilab_sum.bin Binary files differdeleted file mode 100644 index 925a0fc..0000000 --- a/macros/scilab_sum.bin +++ /dev/null diff --git a/macros/scilab_sum.sci b/macros/scilab_sum.sci deleted file mode 100644 index b9c5fa0..0000000 --- a/macros/scilab_sum.sci +++ /dev/null @@ -1,10 +0,0 @@ -// ==================================================================== -// Template toolbox_skeleton -// This file is released under the 3-clause BSD license. See COPYING-BSD. -// ==================================================================== -// -// -function s = scilab_sum(valA,valB) - s = valA + valB; -endfunction -// ==================================================================== |