This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Get the value of a public cache property


value = getp(c,property)



value = getp(c,property) gets the value of a public cache property.

Ordinarily, you would be able to access the public properties of a cache object using the dot notation. For example: c.Connection. However, all cache objects use dot reference and dot assignment to refer to keys stored in the cache rather than cache object properties. Therefore, c.Connection refers to a key named Connection in the cache instead of the cache's Connection property.

There is no setp method since all cache properties are read-only.


collapse all

Start a persistence service that uses Redis™ as the persistence provider. The service requires a connection name and an open port. Once the service is running, you can connect to the service using the connection name and create a cache.

ctrl = mps.cache.control('myRedisConnection','Redis','Port',4519);
c = mps.cache.connect('myCache', 'Connection', 'myRedisConnection');

Retrieve the connection name.

ans =


Input Arguments

collapse all

A data cache represented by a persistence provider specific data cache object.

Currently, Redis and MATLAB® are the only supported persistence providers. Therefore, the cache objects will be of type mps.cache.RedisCache or mps.cache.MATFileCache.

Example: c

Property name, specified as a character vector. The common public cache properties are Name, LocalKeys, and Connection. Provider-specific cache objects may have additional properties. For example, mps.cache.RedisCache has the properties Host and Port.

Example: 'Connection'

Output Arguments

collapse all

A valid property value.

Introduced in R2018b