To split a string in Matlab using forward slash as delimiter, you can use the strsplit
function. Here's an example:
main.m71 chars3 lines
The output myCellArray
will be a cell array with each word separated by forward slash:
main.m93 chars9 lines
If you have a string array, stringArray
, you can split each of its elements using a for loop like this:
main.m136 chars5 lines
The output will be a cell array with each element containing the split strings:
main.m155 chars13 lines
gistlibby LogSnag