This example shows you how to make .NET classes visible to MATLAB® by
loading a global assembly using the
The speech synthesizer class (available in .NET Framework Version 3.0 and above) provides ready-to-use text-to-speech features. For example, type:
NET.addAssembly('System.Speech'); speak = System.Speech.Synthesis.SpeechSynthesizer; speak.Volume = 100; Speak(speak,'You can use .NET Libraries in MATLAB')
The speech synthesizer class, like any .NET class, is part of
an assembly. To work with the class, call
NET.addAssembly to load the assembly
into MATLAB. Your vendor documentation contains the assembly
name. For example, search the Microsoft® .NET Framework website for
System.SpeechSynthesizer class. The assembly
System.Speech assembly is a global assembly.
If your assembly is a private assembly, use
the full path for the input to
The System.DateTime Example does
NET.addAssembly because MATLAB dynamically
loads its assembly (
mscorlib) at startup.
Note: You cannot unload an assembly in MATLAB.
For more information, see: