Effacer les filtres
Effacer les filtres

How to write umax*exp(1​./((th-th0​).*(th-th1​)))/en for th0<th<th1 in matlab?

1 vue (au cours des 30 derniers jours)
, ,
I saw something related to my question
uu = @(th) vif(th>ph0&th<ph1,umax*exp(1./((th-ph0).*(th-ph1)))/en,0)
but unfortunately, 'vif' is not defined. Please I need clarification.

Réponse acceptée

Walter Roberson
Walter Roberson le 7 Nov 2019
Modifié(e) : Walter Roberson le 7 Nov 2019
Assuming that you have assigned a definite vector of values to th, then:
y = nan(size(th));
mask = th0 < th & th < th1;
y(mask) = umax*exp(1./((th(mask)-th0).*(th(mask)-th1)))/en;
  2 commentaires
Kayode Odeyemi
Kayode Odeyemi le 7 Nov 2019
Modifié(e) : Kayode Odeyemi le 7 Nov 2019
Thanks. God bless you. Yes, definite vector of values have assigned to th and umax. I want to write it like
uu = @(th) vif(th>ph0&th<ph1,umax*exp(1./((th-ph0).*(th-ph1)))/en,0)
where vif will also be a function. Please, I need your help.
Walter Roberson
Walter Roberson le 7 Nov 2019
Why do you want to write it that way?
Have you considered using piecewise() from the symbolic toolbox?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types 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