diff options
Diffstat (limited to 'macros/FunctionAnnotation')
-rw-r--r-- | macros/FunctionAnnotation/FA_SZ_DIFF.bin | bin | 0 -> 3876 bytes | |||
-rw-r--r-- | macros/FunctionAnnotation/FA_SZ_DIFF.sci | 39 | ||||
-rw-r--r-- | macros/FunctionAnnotation/lib | bin | 2180 -> 2204 bytes | |||
-rw-r--r-- | macros/FunctionAnnotation/names | 1 |
4 files changed, 40 insertions, 0 deletions
diff --git a/macros/FunctionAnnotation/FA_SZ_DIFF.bin b/macros/FunctionAnnotation/FA_SZ_DIFF.bin Binary files differnew file mode 100644 index 0000000..5f169e6 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_DIFF.bin diff --git a/macros/FunctionAnnotation/FA_SZ_DIFF.sci b/macros/FunctionAnnotation/FA_SZ_DIFF.sci new file mode 100644 index 0000000..df18310 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_DIFF.sci @@ -0,0 +1,39 @@ +// Copyright (C) 2016 - IIT Bombay - FOSSEE +// +// This file must be used under the terms of the CeCILL. +// This source file is licensed as described in the file COPYING, which +// you should have received as part of this distribution. The terms +// are also available at +// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt +// Author: Siddhesh Wani +// Organization: FOSSEE, IIT Bombay +// Email: toolbox@scilab.in + +//This fucntion calulates size of output depending upon input +function outsize = FA_SZ_DIFF(in1size, in2val, in3val) + in1size = string(in1size); + in1row = eval(in1size(1)); + in1col = eval(in1size(2)); + in2val = string(in2val); + in2num = eval(in2val); + in3num = eval(in3val); + +if(in3num == 0) + if((in1row == 1) & (in1col <> 1)) //input is row vector + outsize(1) = '1'; + outsize(2) = string (in1col - in2num); + elseif((in1col == 1) & (in1row <> 1)) //input is column vector + outsize(1) = string(in1row - in2num); + outsize(2) = '1'; + else // input is matrix. output is a column matrix + outsize(1) = string((in1row * in1col)- in2num); + outsize(2) = '1'; + end +elseif (in3num == 1) //Difference along rows + outsize(1) = string(in1row - in2num); + outsize(2) = string(in1col); +elseif (in3num == 2) //Difference along columns + outsize(1) = string(in1row); + outsize(2) = string(in1col - in2num); +end +endfunction
\ No newline at end of file diff --git a/macros/FunctionAnnotation/lib b/macros/FunctionAnnotation/lib Binary files differindex 81fa5d4..b8b2d41 100644 --- a/macros/FunctionAnnotation/lib +++ b/macros/FunctionAnnotation/lib diff --git a/macros/FunctionAnnotation/names b/macros/FunctionAnnotation/names index 5658291..3db59cc 100644 --- a/macros/FunctionAnnotation/names +++ b/macros/FunctionAnnotation/names @@ -14,6 +14,7 @@ FA_SZ_1 FA_SZ_2 FA_SZ_COLUMN_DIAG FA_SZ_COL_DIAG_IN_EX +FA_SZ_DIFF FA_SZ_FROM_VAL FA_SZ_LINSPACE_ROW FA_SZ_OPAPEX |