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 Exchange에서 Characters 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