problem with regexp and split, and picking some cells
Show older comments
I have the following input:
>> data(1).Header
ans =
AF051909 |392-397:CAGCTG| |413-418:CAGGTG|
I needed to save them to cells as {'392-397', 'CAGCTG'; '413-418', 'CAGGTG';}
I so I used regexp to do so with the following code:
struKm(1).trueBinding = regexp(data(1).Header,'\s\||\:|\|','split');
this returns:
>> struKm(1).trueBinding
ans =
'AF051909' '392-397' 'CAGCTG' '' '413-418' 'CAGGTG' ''
as you can see there are to empty cells and I tried to find out why they are there but failed.
I also tried to ignore that and continue to picking up the cell that I need for the rest of my code which is 'CAGCTG' and 'CAGGTG'. I have this code to pick them up:
[r1,r2] = ismember(struKm(1).trueBinding,set)
it return zeros.
Can someone help with two issues please?
Regards, A.
Accepted Answer
More Answers (1)
Abdulaziz
on 3 Oct 2012
Categories
Find more on Data Type Conversion in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!