MATLAB: Dissect a String and create list with Matlab


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 !

Best Answer

  • A = "black || white || pink || yellow"
    B = split(erase(A,'|')).'