From ac01f75eaa0475879647e8c6e1343e4c49d7c18c Mon Sep 17 00:00:00 2001 From: rupak Date: Thu, 10 Oct 2019 12:57:46 +0530 Subject: added help for toolbox --- sci_gateway/cpp/sci_octave.cpp | 217 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 sci_gateway/cpp/sci_octave.cpp (limited to 'sci_gateway/cpp/sci_octave.cpp') diff --git a/sci_gateway/cpp/sci_octave.cpp b/sci_gateway/cpp/sci_octave.cpp new file mode 100644 index 0000000..0e9c228 --- /dev/null +++ b/sci_gateway/cpp/sci_octave.cpp @@ -0,0 +1,217 @@ +#include +#include "wchar.h" +#include + +extern "C" +{ +#include +#include +#include +#include "localization.h" +#include "fun.h" +#include +#include +#include +#include "os_string.h" +#include + + + +static const char fname[] = "octave_fun"; +int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out) + +{ +//printf("nin: %d\n", nin); + if (nin < 2) + { + Scierror(999, _("%s: Wrong number of input arguments. Atleast %d expected.\n"), fname, 2); + return STATUS_ERROR; + } + + FUNCCALL funcall; + FUNCCALL *funptr = &funcall; + funcall.n_in_arguments = nin; + funcall.n_out_user = nout; + + FUNCARGS ins[funcall.n_in_arguments*nout]; + FUNCARGS *argptr = ins; + + int i,j; + double* d; + double* rd; + double* cd; + int size; + char str[20]; + char* c; + double* n = NULL; + int row = 0; + int col = 0; + double* in_real; + double* in_img; + + for(i=0;i