Do not get confused with row numbers in the arrays. I am just asking converting 1 into style 2
This is Cell Array C
I want to convert it to the below version how can i do that ?
V2 =
If I understand correctly, you have a flat cell array of strings (which contain valid MATLAB cell array definitions), and you want to convert each string into a sub-cell-array of its own. So what you need is:
cellfun(@eval, C, 'UniformOutput', false)
Where C
is the original cell array of strings.
Example:
C = {'{''samsung'', ''n150'', ''jp0xtr'', ''n570''};'; ...
'{''samsung'', ''n150'', ''jp0xtr'', ''beyaz''};'}
C2 = cellfun(@eval, C, 'UniformOutput', false)
The result is:
C =
'{'samsung', 'n150', 'jp0xtr', 'n570'};'
'{'samsung', 'n150', 'jp0xtr', 'beyaz'};'
C2 =
{1x4 cell}
{1x4 cell}