> For the complete documentation index, see [llms.txt](https://nelson-9.gitbook.io/nelson/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nelson-9.gitbook.io/nelson/markdown/en/validators/mustbea.md).

# mustBeA

Checks that input value comes from one of specified classes.

## 📝 Syntax

* mustBeA(var, classNames)
* mustBeA(var, classNames, argPosition)
* C++: void mustBeA(const ArrayOfVector& args, const wstringVector \&classNames, int argPosition)

## 📥 Input argument

* var - a variable.
* classNames - a variable: name of data type or class.
* argPosition - a positive integer value: Position of input argument.

## 📄 Description

mustBeA checks that input value comes from one of specified classes.

## 💡 Example

```matlab
mustBeA(1, 'double')
mustBeA([], ["double", "single"])
```

## 🔗 See also

[mustBeNumeric](/nelson/markdown/en/validators/mustbenumeric.md).

## 🕔 History

| Version | 📄 Description  |
| ------- | --------------- |
| 1.0.0   | initial version |
