필터 지우기
필터 지우기

Finding a specific value in Y-axis value with known X-axis value

조회 수: 7 (최근 30일)
Ke Yeun Yong
Ke Yeun Yong 2023년 9월 15일
댓글: Matt J 2023년 9월 15일
Hi, I am trying to find a specific value in Y-axis value with known X-axis value as follow;
Alt = [11000,12000,13000,14000,15000,16000,17000,18000]; % Altitude [m]
Relative_density_ISA = [0.2971,0.2537,0.2167,0.1851,0.1581,0.1350,0.1153,0.0985]; % Relative density under ISA
I am trying to find the altitude which relative density 0.1291 is at.
I applied the -> R_D_wanted =interp1(Alt,Relative_density_ISA,0.1291);
but it gives me NaN result.
Please help, very much appreciated.

채택된 답변

Matt J
Matt J 2023년 9월 15일
편집: Matt J 2023년 9월 15일
Alt = [11000,12000,13000,14000,15000,16000,17000,18000]; % Altitude [m]
Relative_density_ISA = [0.2971,0.2537,0.2167,0.1851,0.1581,0.1350,0.1153,0.0985]; % Relative density under ISA
Alt_wanted =interp1(Relative_density_ISA,Alt,0.1291,'linear')
Alt_wanted = 1.6299e+04
  댓글 수: 2
Ke Yeun Yong
Ke Yeun Yong 2023년 9월 15일
Thank you very much 😃
Matt J
Matt J 2023년 9월 15일
You're welcome, but please Accept-click the answer to indicate that it worked.

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

추가 답변 (1개)

Dark_Knight
Dark_Knight 2023년 9월 15일
Hello Ke Yeun Yong , hope this helps.
% Given Input Data
Alt = [11000, 12000, 13000, 14000, 15000, 16000, 17000, 18000];
Relative_density_ISA = [0.2971, 0.2537, 0.2167, 0.1851, 0.1581, 0.1350, 0.1153, 0.0985];
% Relative Density required
R_D_wanted = interp1(Relative_density_ISA, Alt, 0.1291); % 1.6299e+04
% Relative Density required
R_D_wanted = num2str(interp1(Relative_density_ISA, Alt, 0.1291)); % '16299.4924'

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by