making array in for loop
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Kangkeon Jeon
le 8 Nov 2019
Commenté : Kangkeon Jeon
le 8 Nov 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 commentaires
Shubham Gupta
le 8 Nov 2019
Alignment should be a cell type array to use
Alignment{k} % notice curly paranthesis, it is used cell type arrays.
Réponse acceptée
James Tursa
le 8 Nov 2019
Maybe prior to the loop define Alignment as a cell array to hold your results:
Alignment = cell(10000,1);
1 commentaire
Shubham Gupta
le 8 Nov 2019
But using this means, losing the original data of Alignment which is a char array of (3x158)?
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Multidimensional Arrays dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!