MATLAB Answers

Logistic Function Transform of vector values

125 views (last 30 days)
Oddur Bjarnason
Oddur Bjarnason on 11 Jul 2017
Commented: emjey on 16 Aug 2018
I need to transform the elements of a vector by a logistic function into a vector with elements with values between 0 and 1. I have tried:
S1=(1/(1 + exp(1).^(-1*Stemp)))
S1 and Stemp are vectors containing the same elements.
But get the error message:
Error in Fuzzylogic_cognitive_map (line 13) S1=(1/(1 + exp(1).^(-1*Stemp)))

  1 Comment

emjey
emjey on 16 Aug 2018
or simply (with Grzegorz correction) S1=(1./(1 + exp(-Stemp)))

Sign in to comment.

Accepted Answer

Grzegorz Knor
Grzegorz Knor on 11 Jul 2017
Matrix dimensions must agree. Add dot before division ( / ):
S1=(1./(1 + exp(1).^(-1*Stemp)))

  0 Comments

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!