Interpolate between two signals in Simulink

조회 수: 8 (최근 30일)
Eric Stewart
Eric Stewart 2018년 9월 12일
답변: Aquatris 2018년 9월 12일
I only need to interpolate between two signals. The signals are just calculations for flow rate needed based off altitude. So signals are as follows: 1. Flow rate needed at 47500ft and above in altitude 2. Flow rate needed at 23000ft and below in altitude I just need to interpolate between the signals (ex: 35000ft) to get the needed value, where altitude is always known. The flow rate is calculated with variables that can be changing.
  댓글 수: 1
Eric Stewart
Eric Stewart 2018년 9월 12일
I ended up making a simple linear interpolation subsystem. Kept looking for a block to do this, but my subsystem does the job for me.

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

답변 (1개)

Aquatris
Aquatris 2018년 9월 12일
Here is how linear interpolation works;
y1 = 10; % known flow rate for 47500 ft
y0 = 2; % known flow rate for 23000 ft
x1 = 47500; % constant altitude
x0 = 23000; % constant altitude
x = 35000; % variable altitude
y = y0 + (x-x0)*(y1-y0)/(x1-x0); % needed flow rate
plot([x0 x1],[y0 y1],x,y,'o')
Implement it using the constant blocks and math operation blocks.

카테고리

Help CenterFile Exchange에서 Simulink Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by