Why am I getting the error "Brace indexing is not supported for variables of this type" when using cell of doubles?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi,
I have code I am trying to run which isnt working anymore. The original version is this:
for p = 1:length(file_list)
for c = 1:1
column_1 = cell2mat(basket_data{p,1}(:,c));
end
end
Running this with the cell of cells array basket_data worked fine.
Now I am using a cell of doubles array a_basket_h and it no longer works. I am unsure why however.
Here is the code:
for p = 1:length(file_list)
for c = 1:1
column_2 = cell2mat(a_basket_h{p,1}(:,c));
end
end
Am I incorrectly indexing the cell of doubles? What do I need to change?
Thank you!
0 commentaires
Réponse acceptée
Voss
le 21 Mar 2022
Try removing cell2mat() in the second case:
for p = 1:length(file_list)
for c = 1:1
column_2 = a_basket_h{p,1}(:,c);
end
end
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Cell 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!