How do I change the value of each element in a Matrix that involves a function call. Something like
matrix[i,j] = funct(matrix[i,j]*2)-1;
You can use MapInplace
, for example:
matrix.MapInplace(Math.Sin);
matrix.MapInplace(x => Math.Sin(x-2));
Or as in your example
matrix.MapInplace(x => funct(x*2)-1);