how i can get the first and second letters in cell data
Mostrar comentarios más antiguos
hello all;
i want to get the first and second letters of each row
letters={'Aliadan';'FadumoHassan'; 'Buraaleabi';'kadradahir'};
so, how i can assign first charac of each row in one vector and the second character in each row in another vector.
Respuesta aceptada
Más respuestas (2)
Purushottama Rao
el 16 de Mayo de 2015
Editada: Purushottama Rao
el 16 de Mayo de 2015
for k=1:4
f(k)=letters{k}(1);
end
for k=1:4
g(k)=letters{k}(2);
end
singh
el 16 de Mayo de 2015
for k=1:length(letters)
f(k)=letters{k}(1)
g(k)=letters{k}(2)
end
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!