This project is read-only.

matlab overloads issue..

Apr 3, 2011 at 12:32 PM

In matlab I often see something like that:

a = polyder(p,q) - returns (p*q)' (derviative of multiplication of two polinomials
[a,b] = polyder(p,q) - returns numerator and denumenator of (p/q)'

Result of a function depends on return value type. In c# (as I understed) we can't do it.
What shall we do with it?

Apr 3, 2011 at 2:10 PM

I think the best we can do is to use C# "out" parameters.  This way you can overload on them, which wouldn't be possible with a return type in C#.

I notice that some of the ILNumerics.ILMath implementations return an array containing two items to get around the multiple return problem but that only works if there are always the same number of items returned so probably best to stick with out parameters in all cases.