Create text variable from one other

I have created a text variable as;
Text = "Alex"
and I want to create an other text varible with every second letter of the "Text" varible(Alex). How can I do it?

 採用された回答

Chunru
Chunru 2022 年 8 月 30 日

0 投票

% Use char array
Text = "Alex"
Text = "Alex"
Text1 = char(Text);
Text2 = string(Text1(1:2:end))
Text2 = "Ae"

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

質問済み:

2022 年 8 月 30 日

回答済み:

2022 年 8 月 30 日

Community Treasure Hunt

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

Start Hunting!

Translated by