Function does not return all declared outputs
显示 更早的评论
The following function has three declared outputs. Although each output is correctly calculated, function returns only output variable #1 in the row (verified by changing position of the variables), like there would be only one output variable declared.
----
function [rRollAltAgl, rPitchAltAgl, rRollIas] = evRisk(raw_vector)
%raw_vector = input(prompt);
roll = raw_vector(1);
pitch = raw_vector(2);
ias = raw_vector(3);
altAGL = raw_vector(4);
% ----rRoll_AltAGL Calculation
rRollAltAgl = evalfis(fisStructRoll_AltAGL,[roll altAGL]);
% ----rPitch_AltAGL Calculation
rPitchAltAgl = evalfis(fisStructPitch_AltAGL,[pitch altAGL]);
% ----rRoll_IAS Calculation
% Roll_IAS Excess Over Stall
rollRad = roll*(pi/180); % bank in degrees to radians
GInc = sec(rollRad); % load increase (roll secans)
stallIAS = 72; % stall speed clean config
stallInc = stallIAS * sqrt(GInc); % stall speed increase
iasExc = ias/stallInc; % excess of speed over stall speed
rollIASOutput = (iasExc-1)*100; % value for calculations
% Roll_IAS Risk Assement
if rollIASOutput > 50
rRollIas = 10;
elseif rollIASOutput > 45
rRollIas = 20;
elseif rollIASOutput > 40
rRollIas = 30;
elseif rollIASOutput > 35
rRollIas = 40;
elseif rollIASOutput > 30
rRollIas = 50;
elseif rollIASOutput > 25
rRollIas = 60;
elseif rollIASOutput > 20
rRollIas = 70;
elseif rollIASOutput > 15
rRollIas = 80;
else
rRollIas = 90;
end
end
function Roll_AltAGL_4C = fisStructRoll_AltAGL(~)
Roll_AltAGL_4C = getFISCodeGenerationData('Roll_AltAGL.fis');
end
function Pitch_AltAGL_4C = fisStructPitch_AltAGL(~)
Pitch_AltAGL_4C = getFISCodeGenerationData('Pitch_AltAGL.fis');
end
4 个评论
Walter Roberson
2021-6-21
Please show an example of evaluating it.
It would help to have your two .fis files to test with.
Artur Bogdanowicz
2021-6-21
Walter Roberson
2021-6-21
You can zip other kinds of files and attach the .zip
Artur Bogdanowicz
2021-6-21
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Scope Variables and Generate Names 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!