making array in for loop

7 visualizaciones (últimos 30 días)
Kangkeon Jeon
Kangkeon Jeon el 8 de Nov. de 2019
Comentada: Kangkeon Jeon el 8 de Nov. de 2019
for k = 1:10000
[Score(k), Alignment{k}] = nwalign(p546ref,newones{k});
find_start_stop(Alignment);
find_every_deletion(Alignment);
end
this has "Unable to perform assignment because brace indexing is not supported for variables of this type." error. Why is that?
Score is integer and Alignment is 3x158 char array.
  2 comentarios
Shubham Gupta
Shubham Gupta el 8 de Nov. de 2019
Alignment should be a cell type array to use
Alignment{k} % notice curly paranthesis, it is used cell type arrays.
Kangkeon Jeon
Kangkeon Jeon el 8 de Nov. de 2019
but i don't want to do Alignment(k), because every time i run that code, it should give 10 different Alignment of 3x158 char. I want the whole 3x158 char, not each character within one Alignment

Iniciar sesión para comentar.

Respuesta aceptada

James Tursa
James Tursa el 8 de Nov. de 2019
Maybe prior to the loop define Alignment as a cell array to hold your results:
Alignment = cell(10000,1);
  1 comentario
Shubham Gupta
Shubham Gupta el 8 de Nov. de 2019
But using this means, losing the original data of Alignment which is a char array of (3x158)?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre String Parsing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by