MATLAB: Saying a message in matlab

MATLABmessagesound

1-how can say a message Computerized in matlab? for example
if a=b
saying in Computerized ' a and b are matching'
else
saying in Computerized ' a and b are not matching'
end
2-please tell with which command can run a .mp3 in matlab?

Best Answer

You mean have the computer synthesize speech?
  • On Windows, this can be done using .NET. There happens to be an example of this in a blog post on .NET in MATLAB.
  • On a Mac, use the "say" system command:
system('say "Hello, World!"')
  • On Linux, techniques may vary from distro to distro. Links like this and this may be helpful, and then you can use the system command like in the Mac case.