Create text variable from one other

2 visualizaciones (últimos 30 días)
Berkay
Berkay el 30 de Ag. de 2022
Respondida: Chunru el 30 de Ag. de 2022
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?

Respuesta aceptada

Chunru
Chunru el 30 de Ag. de 2022
% Use char array
Text = "Alex"
Text = "Alex"
Text1 = char(Text);
Text2 = string(Text1(1:2:end))
Text2 = "Ae"

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by