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

7 次查看(过去 30 天)
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

更多回答(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