How to give a alert message with beep sound.

If there is probability of collision. I need to give alert message and beep sound

 Accepted Answer

beep; msgbox('Danger, Will Robinson!')

9 Comments

Error in msgbox (line 285) texthandle = text( ...
Error in CSV (line 18) msgbox('Danger, Will Robinson!')
I'm getting this error
Please show the complete error message, everything in red. Please also show the output of
which -all text
Also, which MATLAB version are you using?
texthandle = text( ... 'Parent' ,AxesHandle , ... 'Units' ,'points' , ... 'String' ,WrapString , ... 'Color' ,get(OKHandle,'ForegroundColor') , ... StFont , ... 'HorizontalAlignment' ,'left' , ... 'VerticalAlignment' ,'bottom' , ... 'Interpreter' ,Interpreter , ... 'Tag' ,'MessageBox' ... );
textExtent = get(texthandle, 'Extent');
Attempt to call constructor text with incorrect letter case.
Error in msgbox (line 285) texthandle = text( ...
Error in inter (line 16) msgbox('Danger, Will Robinson!')
If you use
which text
you will likely see a TEXT.m that is not under the MATLAB installation directory. You need to move that aside or rename it: it is interfering with MATLAB's text function.
you were right, I had file name text which was interfering the function. Thank you ..
I appreciate your work.

Sign in to comment.

More Answers (0)

Products

Community Treasure Hunt

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

Start Hunting!