applyting function to all elements in a matrix
Show older comments
What is1./(1+exp(-z)), (z can be a matrix ) and how is it different from 1/(1+exp(-z))?
2 Comments
Vladimir Sovkov
on 30 Dec 2019
The second version is a little bit strange, although without formal errors. The thing is that exp(-z) is per-element, i.e., it computes the matrix, whose every element is the exponent of the corresponding element of the initial matrix, while the operation / computes the matrix inversion. If you want all the operations to be done in the sense of the matrix algebra, you should use expm(-z). The first version is totally per-element, hence, it looks quite consistent.
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!