problem with regexp and split, and picking some cells
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Abdulaziz
el 3 de Oct. de 2012
2 comentarios
Azzi Abdelmalek
el 3 de Oct. de 2012
post a sample of your data
Abdulaziz
el 3 de Oct. de 2012
Categorías
Más información sobre Data Type Conversion en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!