From db464f35f5a10b58d9ed1085e0b462689adee583 Mon Sep 17 00:00:00 2001 From: Siddhesh Wani Date: Mon, 25 May 2015 14:46:31 +0530 Subject: Original Version --- macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 36 ++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci (limited to 'macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci') diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci new file mode 100644 index 00000000..c3cae536 --- /dev/null +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci @@ -0,0 +1,36 @@ +function opout = FA_SZ_FROM_VAL(in1,in2) +// function opout = FA_SZ_FROM_VAL(in1,in2) +// ----------------------------------------------------------------- +// Return a size according to the floored value of the first argument +// +// Input data: +// in1: string specifying a number . +// +// Output data: +// opout: string containing the computed result. +// +// ----------------------------------------------------------------- + +SCI2CNInArgCheck(argn(2),2,2); + + +if (isnum(in1)) + in1num = eval(in1) ; + if isnan(in1num) + opout = '__SCI2CNANSIZE'; + elseif ( in1num < 0 ) + opout= '0' ; + else + opout = string ( floor (abs(in1num))) ; + + end + + +else + opout = in2+"0floor"+in2+"0"+"("+in1+")"; + opout = in2+"0abs"+in2+"0"+"("+opout+")"; + +end + + +endfunction: -- cgit From ee5bf4d90f78673d1e4d5a9dd304ee53c503c085 Mon Sep 17 00:00:00 2001 From: imushir Date: Tue, 9 Feb 2016 16:38:27 +0530 Subject: Support for Servo motor for Arduino. Support for'diag' in c --- macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci') diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci index c3cae536..bb02b985 100644 --- a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci @@ -15,20 +15,20 @@ SCI2CNInArgCheck(argn(2),2,2); if (isnum(in1)) - in1num = eval(in1) ; - if isnan(in1num) - opout = '__SCI2CNANSIZE'; - elseif ( in1num < 0 ) - opout= '0' ; - else - opout = string ( floor (abs(in1num))) ; - - end + in1num = eval(in1) ; + if isnan(in1num) + opout = '__SCI2CNANSIZE'; + elseif ( in1num < 0 ) + opout= '0' ; + else + opout = string ( floor (abs(in1num))) ; + end else - opout = in2+"0floor"+in2+"0"+"("+in1+")"; - opout = in2+"0abs"+in2+"0"+"("+opout+")"; + opout = in2+"0floor"+in2+"0"+"("+in1+")"; + opout = in2+"0abs"+in2+"0"+"("+opout+")"; + end -- cgit From f0e074cc43f04f58aafe00742b9748a09f77894f Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Thu, 4 May 2017 20:07:20 +0530 Subject: Toolbox working with scilab 6.0 --- macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci') diff --git a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci index bb02b985..5ff03a60 100644 --- a/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci +++ b/macros/FunctionAnnotation/FA_SZ_FROM_VAL.sci @@ -33,4 +33,4 @@ else end -endfunction: +endfunction -- cgit