Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何更改涉及函数调用的矩阵中每个元素的值。就像是
矩阵[i,j] = 函数(matrix[i,j]*2)-1;
您可以使用MapInplace,例如:
MapInplace
matrix.MapInplace(Math.Sin); matrix.MapInplace(x => Math.Sin(x-2));
或者就像你的例子
matrix.MapInplace(x => funct(x*2)-1);