summaryrefslogtreecommitdiff
path: root/sci_gateway/cpp
diff options
context:
space:
mode:
authorrupak2019-08-23 17:41:20 +0530
committerrupak2019-08-23 17:41:20 +0530
commit18719adcd3e801d072085ecb8ed60acbad3ffd0a (patch)
tree776df650afdbcd00396d30f6cc98312963439d7b /sci_gateway/cpp
parent378f77aefd60289e955d1b180e3326e461cfcbec (diff)
downloadfossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.tar.gz
fossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.tar.bz2
fossee-scilab-octave-toolbox-18719adcd3e801d072085ecb8ed60acbad3ffd0a.zip
scilab recieves 1D array from octave
Diffstat (limited to 'sci_gateway/cpp')
-rwxr-xr-xsci_gateway/cpp/libscilab_toolbox.sobin16528 -> 16528 bytes
-rw-r--r--sci_gateway/cpp/sci_matrix.cpp16
2 files changed, 12 insertions, 4 deletions
diff --git a/sci_gateway/cpp/libscilab_toolbox.so b/sci_gateway/cpp/libscilab_toolbox.so
index ed9057f..9cf2138 100755
--- a/sci_gateway/cpp/libscilab_toolbox.so
+++ b/sci_gateway/cpp/libscilab_toolbox.so
Binary files differ
diff --git a/sci_gateway/cpp/sci_matrix.cpp b/sci_gateway/cpp/sci_matrix.cpp
index ca147a7..aa45bed 100644
--- a/sci_gateway/cpp/sci_matrix.cpp
+++ b/sci_gateway/cpp/sci_matrix.cpp
@@ -14,8 +14,10 @@ static const char fname[] = "octave_fun";
int sci_octave_fun(scilabEnv env, int nin, scilabVar* in, int nopt, scilabOpt* opt, int nout, scilabVar* out)
{
-double* out1 = NULL;
-
+ double* out1 = NULL;
+ int n=5;
+ double ar[n];
+
if (nin != 0)
{
Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), fname, 2);
@@ -27,13 +29,19 @@ if (nout != 1)
Scierror(77, _("%s: Wrong number of output argument(s): %d expected.\n"), fname, 1);
return 1;
}
- *out = scilab_createDoubleMatrix2d(env, 1, 1, 0);
+
+ fun(ar, n);
+ *out = scilab_createDoubleMatrix2d(env, n, 1, 0);
//double retval = fun();
//printf("%f\n", retval);
//*out1 = retval;
scilab_getDoubleArray(env, out[0], &out1);
- out1[0]=fun();
+ //out1[0]=fun();
+ for(int i=0; i<n; i++)
+ {
+ out1[i] = ar[i];//.float_value();
+ }
return 0;