Main Content

matlab.task.configureMetadata

Configure Live Editor task metadata

Since R2022a

    Description

    matlab.task.configureMetadata opens a file selection dialog box prompting you to select a class definition file, and then opens the Task Metadata dialog box to configure the metadata for the Live Editor task specified by the selected file. The Live Editor uses this metadata to display the task in the Live Editor task gallery as well as in automatic code suggestions and completions.

    This function generates a folder named resources that contains the metadata file liveTasks.json. Share this folder when you share your Live Editor task.

    matlab.task.configureMetadata(classfile) opens the Task Metadata dialog box to configure the metadata for the Live Editor task specified by classfile.

    example

    Examples

    collapse all

    Suppose you created the Display Image Live Editor task by defining a subclass of the matlab.task.LiveTask base class and saving the class file as DisplayImage.m in the folder C:\MyTasks. Launch the Task Metadata dialog box to configure the Display Image task.

    matlab.task.configureMetadata("C:\MyTasks\DisplayImage.m")

    Task Metadata dialog box with the required task metadata prepopulated

    Fill out the form, and select OK. The function generates a folder named resources with the specified metadata in the C:\MyTasks folder. Add C:\MyTasks to the MATLAB® path using the addpath function or the Add Folder button in the Set Path dialog box.

    To view your task in the Live Editor task gallery, go to the Live Editor tab and in the Code section, select Task > DisplayImage. MATLAB adds the Display Image task to the live script.

    Display Image task in a live script

    Input Arguments

    collapse all

    Path to the Live Editor task class file, specified as a string scalar or character vector. classfile can be an absolute or relative path.

    Example: "NormalizeVectorData.m"

    Example: "C:\MyTasks\DisplayImage.m"

    More About

    collapse all

    Version History

    Introduced in R2022a