Mathematica的一道很简单的函数应用题,求大神帮忙
See the following statement. What does it do? Create a function that takes as input the matrix mat, and then for each element compares it with value 尀[Tau], and if a value is below 尀[Tau], it should be set to zero, else to 1。mat = RandomInteger[100, RandomInteger[{15, 25}, 2]]我自己写的是Resetlist[l_, x_] := For[i = 1, i <= Length[l], i++, If[l[[i]] < x, l[[i]] = 0, l[[i]] = 1]; If[i == Length[l], Print[l]]]但是好像运行不行