Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.
Boolean expression error in variable.
Posted 2 avr. 2012, 01:24 UTC−4 1 Reply
Please login with a confirmed email address before reporting spam
dear all,
i have a boolean logic expression,
if t >= 0, t < 0.2
F = 1./(1+exp(-140*(t-0.08)))
if t >= 0.2 and t< 1
F = 1./(1+exp(60.61*(t-0.35)))
when i use below boolean expression in the variable, it end up that the the two statement is added up and the maximum y magnitude jump to 2, while when i use matlab, it is 1.
(t>=0)*(1/(1+exp(-140*(t[s]-0.08))))+(t>0 && t<0.2)*(1/(1+exp(-140*(t[s]-0.08))))+(t>=0.2&&t<1)*(1/(1+exp(60.61*(t[s]-0.35))))
can someone give me some me some help or hint where i make the mistake?
Thank you.
i have a boolean logic expression,
if t >= 0, t < 0.2
F = 1./(1+exp(-140*(t-0.08)))
if t >= 0.2 and t< 1
F = 1./(1+exp(60.61*(t-0.35)))
when i use below boolean expression in the variable, it end up that the the two statement is added up and the maximum y magnitude jump to 2, while when i use matlab, it is 1.
(t>=0)*(1/(1+exp(-140*(t[s]-0.08))))+(t>0 && t<0.2)*(1/(1+exp(-140*(t[s]-0.08))))+(t>=0.2&&t<1)*(1/(1+exp(60.61*(t[s]-0.35))))
can someone give me some me some help or hint where i make the mistake?
Thank you.
1 Reply Last Post 2 avr. 2012, 12:51 UTC−4