Main Content

addMacro

Class: coder.make.ToolchainInfo
Namespace: coder.make

Add macro to Macros

Syntax

h.addMacro(macroname)
h.addMacro(macroname, macrovalue)

Description

h.addMacro(macroname) adds a macro to coder.make.ToolchainInfo.Macros without initializing the value of the Macro.

h.addMacro(macroname, macrovalue) adds a macro and initializes the value of the macro.

Input Arguments

expand all

A coder.make.ToolchainInfo object, specified using an object handle, such as h. To create h, enter h = coder.make.ToolchainInfo in a MATLAB® Command Window.

Name of macro.

Value of the macro, specified as a character vector, string scalar, or cell array.

If the value contains MATLAB functions or other macros, ToolchainInfo interprets the value of functions and macros.

Data Types: cell | char | string

Examples

h.setMacro('CYGWIN','C:\cygwin\');
h.getMacro('CYGWIN')
ans  = 

C:\cygwin\bin\

h.removeMacro('CYGWIN')

Tips

Use setMacro to update the value of a macro in coder.make.ToolchainInfo.Macros.

Version History

Introduced in R2013a