Borrar filtros
Borrar filtros

How can i compare these two protein sequences?

3 visualizaciones (últimos 30 días)
Toby  Pendlebury
Toby Pendlebury el 6 de Dic. de 2016
Comentada: Toby Pendlebury el 6 de Dic. de 2016
I am trying to compare two cell arrays that contain a protein sequence fragmented up into chunks of two. I am comparing them to see if there are any matches between the sections of two in one sequence to the other, but i keep bumping into this error...
x=length(Prot_H_cell);
y=length(Prot_M_cell);
for ii=Prot_H_cell(1:x);
for jj=Prot_M_cell(1:y);
W(ii,jj)={strcmp(Prot_H_cell(ii),Prot_M_cell(jj))}
end
end
Function 'subsindex' is not defined for values of class 'cell'.- error message

Respuesta aceptada

dbmn
dbmn el 6 de Dic. de 2016
I made a MWE and got a solution. When you see what was wrong you will say "oh man"....
I used the following as an input.
Prot_H_cell = {'AA', 'BB', 'AB', 'AC'};
Prot_M_cell = {'CC', 'AC', 'DA', 'AA'};
This code will fail
x=length(Prot_H_cell);
y=length(Prot_M_cell);
for ii=Prot_H_cell(1:x);
for jj=Prot_M_cell(1:y);
W(ii,jj)={strcmp(Prot_H_cell(ii),Prot_M_cell(jj))}
end
end
And this wont cause the error
x=length(Prot_H_cell);
y=length(Prot_M_cell);
for ii=1:x
for jj=1:y
W(ii,jj)={strcmp(Prot_H_cell(ii),Prot_M_cell(jj))}
end
end
hope this helps.
  1 comentario
Toby  Pendlebury
Toby Pendlebury el 6 de Dic. de 2016
Your not wrong i did say "oh man" thank you so much, been stuck on this for days.

Iniciar sesión para comentar.

Más respuestas (1)

KSSV
KSSV el 6 de Dic. de 2016
Try
W{ii,jj}=strcmp(Prot_H_cell(ii),Prot_M_cell(jj)) ;
  5 comentarios
KSSV
KSSV el 6 de Dic. de 2016
class of Prot_H_cell and Prot_M_cell...
Toby  Pendlebury
Toby Pendlebury el 6 de Dic. de 2016
They are both class: cell

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by