I have Matlab function, which takes as parameters two 1-d arrays of doubles. There are hundreds of thousands items in each array. I’ve created .NET assembly library and using it in my C# application.
If I’m passing these arrays using MWArray
from my C# app, running function takes significantly longer, than if I simply write these arrays into files (one double on each row) then pass file names to Matlab function and there I load
them into Matlab vector.
Question – how can I optimize passing arrays between C# application and Matlab .NET library to take similar time as if I load them in Matlab function?