Can characters be used as indices?

Viewed 71

Let's define, for example,

x = 10:10:2000;

As is well known, integer values can be used as indices:

>> x(9)
ans =
    90

In Matlab, characters can often be used where a number would be expected, with Matlab doing the conversion automatically. For example, since the ASCII code of 'a' is 97,

>> 'a'+1
ans =
    98

Can characters be also used as indices? Does Matlab convert them into integers?

1 Answers
Related