Main Content

getmcruserdata

检索MATLABarray value associated with a given key

Description

value= getmcruserdata(key)returns MATLAB®data associated with the stringkeyin the currentMATLAB Runtimeinstance. If there is no data associated with the key, it returns an empty matrix.

This function is part of theMATLAB RuntimeUser Data interface API. It is available both in MATLAB and in deployed applications created withMATLAB Compiler™andMATLAB Compiler SDK™.

Examples

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

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

Input Arguments

collapse all

keyis the MATLAB string with which MATLAB datavalueis associated within the current instance of theMATLAB Runtime.

Output Arguments

collapse all

valueis the MATLAB data associated with input stringkeyfor the current instance of theMATLAB Runtime.

Version History

Introduced in R2008b

See Also