Dissect a String and create list with Matlab

1 vue (au cours des 30 derniers jours)
Lucas S
Lucas S le 2 Mai 2019
Commenté : Lucas S le 2 Mai 2019
Hello !
I come from Python and i would like, with Matlab, to dissect a string and keep each part in a List. Like that :
A = "black || white || pink || yellow"
and so i would like to have
B = ["black", "white", "pink", "yellow"]
Thanks for helping !

Réponse acceptée

Jos (10584)
Jos (10584) le 2 Mai 2019
A = "black || white || pink || yellow"
B = split(erase(A,'|')).'

Plus de réponses (0)

Catégories

En savoir plus sur Simulink dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by