how to make an array of characters of variable length?

5 views (last 30 days)
I want to make an array of unique characters or strings of variable length (n) e.g n=5. so I can't use 'a':'e' cause 'e' is not constant it depends on n which varies continuously ...I don't know the 'e' ....I just know that i want an array e.g from 'a' to a+n
Any help is highly appreciated. Thanks

Accepted Answer

Walter Roberson
Walter Roberson on 12 Jun 2021
n=5;
'a':char('a'+n-1)
ans = 'abcde'

More Answers (0)

Categories

Find more on Characters and Strings in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!