MATLAB: Using reshape on multiline character arrays

character arraysMATLABreshape

I have a cell array of regular character data that I have read from a file.
'0017007B02F00000----------------013002EB00000000'
'0017007B02F00000----------------013002EB00000000'
'0033007B02F00000----------------013002EB00000000'
'0033007B02F00000----------------013002EB00000000'
I want to split this into chunks of 4 so I can use hex2dec on each chunk. I'm able to do this for one line as follows:
reshape('0017007B02F00000----------------013002EB00000000',4,[])'
ans =
12×4 char array
'0017'
'007B'
'02F0'
'0000'
'----'
'----'
'----'
'----'
'0130'
'02EB'
'0000'
'0000'
However, would there be any way to do the whole array at once so I don't have to reshape line by line?
I am using Matlab 2017b.

Best Answer

reshape(char(theArray).',4,[]).'