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 CenterFile Exchange 中查找有关 Cell Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by