MATLAB: Splitting Characters in A Cell Array

cell arraycellfunstring

Hi All,
I am trying to split some content in a cell array into separate portions. I've tried converting to a string and using strsplit, but I am not getting the results I want because of the datatype syntax.
Came across the cellfun command, but not really sure how to implement it.
Here is what I have
'P245/65R17 105S'
'P265/70R16 111S'
'P275/55R20 111H'
'285/60R18 120H'
'P235/70R17 108S'
What I need:
'P245/' '65' 'R' '17' '105' 'S'
'P265/' '70' 'R' '16' '111' 'S'
'P275/' '55' 'R' '20' '111' 'H'
'285/' '60' 'R' '18' '120' 'H'
'P235/' '70' 'R' '17' '108' 'S'
Thanks in advance!

Best Answer

Data = {'P245/65R17 105S'; ...
'P265/70R16 111S'; ...
'P275/55R20 111H'; ...
'285/60R18 120H'; ...
'P235/70R17 108S'};
n = numel(Data);
Result = cell(n, 6);
for k = 1:n
S = Data{k};
p = strfind(S, '/');
% 'P245/65R17 105S'
% 'P245/' '65' 'R' '17' '105' 'S'
Result(k, :) = {S(1:p), S(p+1:p+2), S(p+3), S(p+4:p+5), S(p+7:p+9), S(p+10)};
end
Does this help already? Or do strings appear, which do not match this pattern? If so, you can search for the space also, use the length of the strings or whatever.