Why am I getting the error "Brace indexing is not supported for variables of this type" when using cell of doubles?

2 ビュー (過去 30 日間)
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!

採用された回答

Voss
Voss 2022 年 3 月 21 日
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 件)

カテゴリ

Help Center および File ExchangeCell Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by