Dear wiebe@CARYA and MarcDub thank you for your suggestions. I'll implement a simple .dll with MATLAB and tell you if there is still a problem, which means that the code generated through that coder has some issues when dealing with arrays. Indeed a simple .dll doing the sum of just two scalar works with no problems.
You need to make a test dll to see if the calling convention is correct.
If you make a dll with two arrays as input, you still won't know. If the order is reversed, you'd still get the expected result.
Make a dll with an array and a scalar. Add the scalar to the array. If that works, your calling convention is correct.
The main difference is that in Labview I implement the function with the convolution, while MATLAB uses the complex-error-function as a sort of lookup table, and with this approach the generation is much faster. Indeed the implementation of the voigt lineshape with the complex-error-function has been treated with the purpose to fasten fitting algorithm of datasets similiar to the ones i'm collecting.
Of course you could implement the same in LabVIEW too. I do fitting on very complicated models (example) in pure LabVIEW and of course use all the tricks in the book, such as lookup tables, vectorization, and caching of intermediary results, etc.
An unbounded Matlab array is in reality a somewhat complicated data structure that you have to create, reallocate and deallocate by calling specific Matlab C runtime functions. The LabVIEW Call Library Node has ABSOLUTELY no knowledge about this. The standard way is to write a wrapper DLL in C which provides more LabVIEW friendly parameters and translates them into the Matlab unbounded arrays before calling the Matlab DLL function (and possibly translates similar output arrays back into LabVIEW friendly datatypes before returning to LabVIEW.
It is theoretically possible to call the Matlab C runtime functions to deal with unbounded arrays also through additional Call Library Nodes so you don’t need to create the extra wrapper DLL but this requires even more low level C programming knowledge than writing the wrapper DLL, since you will basically take over some of the work the C compiler would do for you.