필터 지우기
필터 지우기

Saturating Functions at a certain value

조회 수: 43 (최근 30일)
Momen Elhassan
Momen Elhassan 2020년 5월 22일
댓글: Walter Roberson 2020년 5월 22일
How do you saturate a function at a certain value on matlab? say for example I have the array x=[0:0.01:20] and the function expo=2.^x, and I want to plot the function expo with respect to x but I want the values to saturate when it reaches 1000 and remain equal to 1000 until the end of the array, looked up a bunch of stuff but all of it was useless.

답변 (1개)

Fangjun Jiang
Fangjun Jiang 2020년 5월 22일
x=[0:0.01:20];
expo=@(x) min(2.^x,100);
plot(x,expo(x));
  댓글 수: 4
Momen Elhassan
Momen Elhassan 2020년 5월 22일
thanks
Walter Roberson
Walter Roberson 2020년 5월 22일
max(lower_limit, min(YourArray, upper_limit))

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

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by