Main Content

getmcruserdata

Retrieve MATLAB array value associated with a given key

Description

value = getmcruserdata(key) returns MATLAB® data associated with the string key in the current MATLAB Runtime instance. If there is no data associated with the key, it returns an empty matrix.

This function is part of the MATLAB Runtime User Data interface API. It is available both in MATLAB and in deployed applications created with MATLAB Compiler™ and MATLAB Compiler SDK™.

Examples

Get the magic square data associated with the string 'magic' in the current instance of the MATLAB Runtime.

value = magic(3);
setmcruserdata('magic', value);
getmcruserdata('magic')
ans =
     8     1     6
     3     5     7
     4     9     2

Input Arguments

collapse all

key is the MATLAB string with which MATLAB data value is associated within the current instance of the MATLAB Runtime.

Output Arguments

collapse all

value is the MATLAB data associated with input string key for the current instance of the MATLAB Runtime.

Version History

Introduced in R2008b