I m trying to do the equivalent of the following matlab function:
outmatrix = bsxfun(@minus,inmatrix, invector);
in c sharp. I used this:
public static ILArray<double> bsxfun(ILArray<double> inmatrix, ILArray<double> invector)
{
for(int i=0; i < inmatrix.getlength(1) ;i++)
{
inmatrix[":",i] = inmatrix[":",i] -invector;
}
return inmatrix;
}
Utilizing ILNumerics package.
My questions: is this the most efficient way? because my matrices can be large. How can I generalize this so that I can specify whether to do minus, plus, times, divide, etc like with a funciton handle?