MATLAB: How to marshal to MATLAB COM Interop

cominterop

Hello,
I'm pretty sure I am seeing a marshaling issue interfacing with MATLAB. I've got a client wiring up just fine in a C# program, and want to call fft, I gather through the Feval call.
Question (or questions) is (are), how to specify and/or marshal the requisite inputs and outputs in such a way that we get the desired response.
There' a follow on call in many of the fft examples to linspace, but I gather that technically this is optional, unless we want to wire up for visualization or otherwise.
I've verified on the "simple" hello world scenario, I call Feval to "version" and obtain the desired response. Now I want to step it up a notch for fft, and so on.
Next from that, various bandpass filters.
I should also mention, we're running against R2011b.
Thank you.

Best Answer

Working through the examples via COM Interop, I am able to make a similar call to the "linspace".
matlab.Feval(@"linspace", 1, out lso, 0d, 1d, nfft / 2 + 1);
And with a bit of C# extension method and lambda persuasion, extract out the desired result.
So at this point I am thinking it's something in how arrays are being passed into MATLAB.
Am I in the ball park if I assume (which I am loathe to do) that it prefers arrays to be 2-dimensional, even if we're talking about a "single dimension" of sampled data? So in other words, instead of double[] (C#), I should be transforming that into double[,]?
Thank you...