applyting function to all elements in a matrix
이전 댓글 표시
What is1./(1+exp(-z)), (z can be a matrix ) and how is it different from 1/(1+exp(-z))?
댓글 수: 2
Vladimir Sovkov
2019년 12월 30일
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!