Main Content

matlab::data::Reference

C++ class to get reference to element ofStringArray

Description

AReferenceobject is created when usingoperator[]into aStringArrayor dereferencing a String array iterator.

Class Details

Namespace:

matlab::data

Include:

MATLABStringReferenceExt.hpp

Cast

String()

运营商年代tring() const

Returns

matlab::data::String

Element of aMATLABStringarray converted toString.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

std::runtime_error

Array element does not have a value.

Member Functions

bool

operator bool() const
Description

Check whether string contains a value.

Returns

operator

True, if string contains a value.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

has_value

bool has_value() const
Description

Check whether string contains a value.

Returns

bool

True, if string contains a value.

Throws

matlab::data::NotEnoughIndicesProvidedException

Not enough indices provided.

matlab::data::InvalidArrayIndexException

Index provided is not valid for this Array or one of the indices is out of range.

matlab::data::TooManyIndicesProvidedException

Too many indices provided.

Version History

Introduced in R2017b