R2025a

New Features, Bug Fixes, Compatibility Considerations

LLMs with MATLAB (GitHub): Ensure output format

You can now use structured outputs to generate output using openAIChat (GitHub®), azureChat (GitHub), and ollamaChat (GitHub) objects. Using structured outputs enforces the structure of the generated output from supported large language models for postprocessing and data analysis.

You can specify the structure of the output in two ways:

  • Specify a valid JSON Schema directly.

  • Specify an example structure array that adheres to the required output format. The software automatically generates the corresponding JSON Schema and provides it to the LLM. Then, the software automatically converts the output of the LLM back into a structure array.

To specify the structure of the output, set the ResponseFormat name-value argument of openAIChat, azureChat, ollamaChat, or generate (GitHub) to one of these options:

  • A string scalar containing a valid JSON Schema

  • A structure array containing an example that adheres to the required format, for example: ResponseFormat=struct("Name","Rudolph","NoseColor",[255 0 0])

For more information on structured outputs, see https://platform.openai.com/docs/guides/structured-outputs.

You can download Large Language Models (LLMs) with MATLAB® from the Add-On Explorer. You can also download it from https://github.com/matlab-deep-learning/llms-with-matlab/.

LLMs with MATLAB (GitHub): Generate text with OpenAI o1 models

You can now use the OpenAI® models o1-mini and o1-preview to generate text from MATLAB. When you create an openAIChat (GitHub) object, set the ModelName name-value argument to "o1-mini" or "o1-preview".

You can download Large Language Models (LLMs) with MATLAB from the Add-On Explorer. You can also download it from https://github.com/matlab-deep-learning/llms-with-matlab/.

LLMs with MATLAB (GitHub): Temporarily override model parameters when generating text

You can now set model parameters such as MaxNumToken and ResponseFormat for a single API call by using the corresponding name-value arguments of the generate (GitHub) function. The generate function then uses the specified parameter for text generation instead of the corresponding model parameter of the openAIChat (GitHub), azureChat (GitHub), or ollamaChat (GitHub) input.

For a full list of supported model parameters, see generate (GitHub).

You can download Large Language Models (LLMs) with MATLAB from the Add-On Explorer. You can also download it from https://github.com/matlab-deep-learning/llms-with-matlab/.

 correctSpelling: New and updated extension dictionaries

By default, the correctSpelling function now recognizes words from MathWorks® default extension dictionaries as correct. For example, the function recognizes the word "MATLAB" and function names such as "correctSpelling". To disable this feature and reproduce the default behavior from previous releases, set ExtensionDictionary to [].

 Functionality Being Removed or Changed

FontSmoothing property of TextScatter objects has no effect

Behavior change

The FontSmoothing property of TextScatter objects has no effect. Font smoothing is enabled regardless of the value of the property. For more information about TextScatter properties, see TextScatter Properties.

This property will be removed in a future release.