필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
, ,
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.

채택된 답변

Walter Roberson
Walter Roberson 2019년 11월 7일
편집: Walter Roberson 2019년 11월 7일
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
Kayode Odeyemi
Kayode Odeyemi 2019년 11월 7일
편집: Kayode Odeyemi 2019년 11월 7일
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 2019년 11월 7일
Why do you want to write it that way?
Have you considered using piecewise() from the symbolic toolbox?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by