MATLAB: How to use the split function with multiple delimiters

MATLABsimulink

I am trying to use the split command on a cell Array but I am getting this error:
Element 77 of the text contains 2 delimiters while the previous elements have 1. All
elements must contain the same number of delimiters.
The problem is that in the line below
software_logical/forIteratorSubsystem/Out1. Some of the elements in my have different number of delimiters.
software_math/sum
This the code I am using below. What can I do so that my program will split at the last delimiter ('/')
cellArray = split(compareBlocks,'/');
cellArray = split(compareBlocks,'/',2); %I even tride using this but it does not work

Best Answer

>> str = 'software_logical/forIteratorSubsystem/Out1';
>> [one,two] = fileparts(str)
one = software_logical/forIteratorSubsystem
two = Out1
>> str = 'software_math/sum';
>> [one,two] = fileparts(str)
one = software_math
two = sum
For character vectors in a cell array call fileparts inside of cellfun.