how to call Calling an audio file into an if function!
조회 수: 3 (최근 30일)
이전 댓글 표시
function ProximityFunction (f)
%UNTITLED2 Summary of this function goes here
% Detailed explanation goes here
if 10000 < f && f < 12000
warningMessage = sprintf('Warning: your altitude = %f\nYou may crash!', f);
uiwait(warndlg('Increase Altitude'));
elseif 5000<f && f <10000;
warningMessage = sprintf('Warning: your altitude = %f\nYou may crash!', f);
uiwait(warndlg('Too close to terrain'));
elseif f <5000
warningMessage = sprintf('Warning: your altitude = %f\nYou may crash!', f);
uiwait(warndlg('PULL UP PULL UP'));
end
end
I want to add an audio file which i have already uploaded into matlab. would i be able to use play(player)to play the audio. I want 'play(player') to be after the warning message has been displayed and I am planning to add audio to the other warning messages. how can i get around this
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio I/O and Waveform Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!