I get an error when trying to run my function using a simulink block.
이전 댓글 표시
function [DefuelSwitch, Defuel, EnginesOnSwitch] = defuelingtrigger(u)
% Unpack the inputs
time = u(1);
%fprintf('Pilot: Time[%f]\n',time);
% Switches
DefuelSwitchInput = u(2);
EnginesOnSwitchInput = u(3);
Defuel = u(4);
DefuelSwitch = DefuelSwitchInput;
EnginesOnSwitch = EnginesOnSwitchInput;
Defuel = -(RefuelQuantity) ;
if (DefuelSwitch == 1) && (EnginesOnSwitch == 1)
DefuelSwitch = 0;
EnginesOnSwitch = 0;
disp('Both switches can not be ON at the same time')
y = [DefuelSwitch, Defuel, EnginesOnSwitch];
end
% Pack the outputs
y(2) = DefuelSwitch;
y(4) = Defuel;
y(3) = EnginesOnSwitch;
end
%the imputs are in my simulink model and its only returning one output.
% im a novice so any suggestions will be appreciated!
댓글 수: 4
Sulaymon Eshkabilov
2022년 12월 28일
This is your MATLAB code and what about your Simulink model?
osman cusmaan
2022년 12월 28일
osman cusmaan
2022년 12월 28일
osman cusmaan
2022년 12월 28일
편집: osman cusmaan
2022년 12월 28일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 General Applications에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
