Logistic Function Transform of vector values

21 vues (au cours des 30 derniers jours)
Oddur Bjarnason
Oddur Bjarnason le 11 Juil 2017
Commenté : emjey le 16 Août 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 commentaire
emjey
emjey le 16 Août 2018
or simply (with Grzegorz correction) S1=(1./(1 + exp(-Stemp)))

Connectez-vous pour commenter.

Réponse acceptée

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

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by