GNU Octave method to operate on each item in a matrix. octave “arrayfun(…)” example

arrayfun works well for this:

arrayfun(@(x) 1/(1+e^(-x)), [0, 1; 2, 3])

Output:

ans =

   0.50000   0.73106
   0.88080   0.95257

This basically runs function 1/(1+e^(-x)) on each element of the matrix/vector.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)