what is the error here?
Afficher commentaires plus anciens
data1 = [data1,(text(k,6))];
Error using horzcat CAT arguments dimensions are not consistent.
Error in data1 = [data1,(text(k,6))];
4 commentaires
Amr Hashem
le 15 Mai 2015
James Tursa
le 15 Mai 2015
Modifié(e) : James Tursa
le 16 Mai 2015
What are the contents of datatext and text? I.e., what are the underlying variable types and sizes?
Are you sure you want the test to be datatext{Q,1}==text{k,1} and not something like isequal(datatext{Q,1},text{k,1})?
Why are you manually incrementing the for-loop index k within the loop?
Amr Hashem
le 16 Mai 2015
Amr Hashem
le 16 Mai 2015
Modifié(e) : per isakson
le 16 Mai 2015
Réponses (1)
Walter Roberson
le 17 Mai 2015
You need to find an empty position in datatext(Q,:) to assign into. For example,
nextslot = find(cellfun(@isempty,datatext(Q,:)));
if isempty(nextslot)
nextslot = size(datatext,2);
end
datatext{Q,nextslot} = text{k,6};
This will grow datatext wider if necessary in order to handle the new information.
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

