target.export - Export target object data - MATLAB (original) (raw)

Export target object data

Syntax

Description

target.export([targetObject](#mw%5Fb5b458c3-b858-4929-bd6d-07aa50cdf266)) exports the specified target object data to a MATLAB® function, registerTargets.m. Use the generated file to share target feature data between sessions and computers. When you runregisterTargets.m, it recreates the target object and adds the object to an internal database.

target.export([targetObject](#mw%5Fb5b458c3-b858-4929-bd6d-07aa50cdf266),[Name,Value](#namevaluepairarguments)) exports the specified target object data using one or more name-value pair arguments.

Examples

collapse all

You can share hardware device data across computers and users.

Specify two hardware devices.

langImp1 = target.create('LanguageImplementation', ... 'Name', 'MyLanguageImplementation1', ... 'Copy', 'ARM Compatible-ARM Cortex');

langImp2 = target.create('LanguageImplementation', ... 'Name', 'MyLanguageImplementation2', ... 'Copy', 'Atmel-AVR');

myProc1 = target.create('Processor','Name','MyProcessor1'); myProc1.LanguageImplementations = [langImp1, langImp2]; objectsAdded1 = target.add(myProc1, ... 'UserInstall',true, ... 'SuppressOutput',true);

myProc2 = target.create('Processor','Name','MyProcessor2'); objectsAdded2 = target.add(myProc2, ... 'UserInstall',true, ... 'SuppressOutput',true);

Run the target.export function.

target.export([myProc1, myProc2], 'FileName', 'exportMyProcFunction')

The function generates exportMyProcFunction.m in the current working folder. Use the generated function to share hardware device data across computers and users. For example, on another computer, run this command:

addedObjects = exportMyProcFunction;

The generated function recreates and adds the objects to an internal database.

If you want the hardware device data to persist over MATLAB sessions, run:

addedObjects = exportMyProcFunction('UserInstall',true);

Input Arguments

collapse all

Specify the target objects that you want to export.

Example: target.export(myTargetObject);

Name-Value Arguments

collapse all

Example: target.export(myTargetObject,'FileName', 'exportMyTargetFn');

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value.Name must appear inside quotes. You can specify several name and value pair arguments in any order asName1,Value1,...,NameN,ValueN.

Specify name of MATLAB function file that contains exported target data.

Version History

Introduced in R2019b