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.

    example

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

    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

    Dialog Box Options

    This table gives a summary of each of the options in the Live Editor Task Metadata dialog box.

    OptionSummary
    Name

    Specify the name of the task to display in the autocompletion list and in the Live Editor task gallery.

    This detail is required.

    Description

    Specify the description of the task to display in the autocompletion list and in the Live Editor task gallery.

    This detail is optional.

    Icon

    Specify the path for the task icon to display in the Live Editor task gallery. If you specify a task icon, MATLAB copies it to the resources folder.

    This detail is optional.

    Keywords

    Specify the keywords that can be used to show the task in the autocompletion list.

    This detail is optional.

    Documentation Link

    Specify the documentation link as a URL to the documentation that opens when the task help icon is clicked.

    To specify a function that returns a documentation link dynamically, include the text taskmethod: followed by the name of the function that returns the doc link. For example, taskmethod:fetchHelpLink. The function must be defined as a public method in the task class definition file.

    If a documentation link is not specified, clicking the task help icon opens the generated help for the task in the Help browser.

    This detail is optional.

    Normalize Vector Data task with the help icon at the top-right circled in red

    Version History

    Introduced in R2022a