Effacer les filtres
Effacer les filtres

cut character from string

62 vues (au cours des 30 derniers jours)
Abdulkareem
Abdulkareem le 31 Jan 2014
Modifié(e) : Amit le 31 Jan 2014
hi i need to cut some characters from a string for example ss='bs15';
i need to split ss to ss1=bs ss2=15 i used strsplit but this function is undefined in my matlab (matlab R2012a)

Réponse acceptée

Amit
Amit le 31 Jan 2014
Modifié(e) : Amit le 31 Jan 2014
ss1 = ss(1:2);
ss2 = ss(3:4);
In matlab strings are vectors of type char. So you can use indexing.
  1 commentaire
Amit
Amit le 31 Jan 2014
Modifié(e) : Amit le 31 Jan 2014
and strsplit function is in 2013a and later. However, strsplit needs a delimiter or space to split strings!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Characters and Strings dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by