필터 지우기
필터 지우기

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