28.12.2012 Views

Figure Properties - SERC

Figure Properties - SERC

Figure Properties - SERC

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

genvarname<br />

2genvarname<br />

Purpose Construct valid variable name from string<br />

Syntax varname = genvarname(str)<br />

varname = genvarname(str, exclusions)<br />

Description varname = genvarname(str) constructs a string varname that is similar to or<br />

the same as the str input, and can be used as a valid variable name. str can<br />

be a single character array or a cell array of strings. If str is a cell array of<br />

strings, genvarname returns a cell array of strings in varname. The strings in a<br />

cell array returned by genvarname are guaranteed to be different from each<br />

other.<br />

2-962<br />

varname = genvarname(str, exclusions) returns a valid variable name that<br />

is different from any name listed in the exclusions input. The exclusions<br />

input can be a single character array or a cell array of strings. Specify the<br />

string 'who' for exclusions to create a variable name that will be unique in the<br />

current MATLAB workapace (see “Example 4”, below).<br />

Note genvarname returns a string that can be used as a variable name. It<br />

does not create a variable in the MATLAB workspace. You cannot, therefore,<br />

assign a value to the output of genvarname.<br />

Remarks A valid MATLAB variable name is a character string of letters, digits, and<br />

underscores, such that the first character is a letter, and the length of the<br />

string is less than or equal to the value returned by the namelengthmax<br />

function. Any string that excedes namelengthmax is truncated in the varname<br />

output. See “Example 6”, below.<br />

The variable name returned by genvarname is not guaranteed to be different<br />

from other variable names currently in the MATLAB workspace unless you use<br />

the exclusions input in the manner shown in “Example 4”, below.<br />

If you use genvarname to generate a field name for a structure, MATLAB does<br />

create a variable for the structure and field in the MATLAB workspace. See<br />

“Example 3”, below.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!