How to add a cell array inside another cell array in a nested for loop?
이전 댓글 표시
Hello everyone.
I would like to know how I could make this one. I`m trying this:
for i=1:sets
for j = 1:n_disc
x_r = A{i}*(data{i}(j,:)');
X_r{1,i}(1,j) = {[x_r]};
end
end
But I get this error:
Index in position 1 exceeds array bounds (must not exceed 53).
How could I make this work?
댓글 수: 7
Omar Andrés Rosada González
2020년 9월 25일
KSSV
2020년 9월 25일
You have not mentioned the line number of error. Dimensions of the data is not known.
Try using. X_r{i} instead of X_r{1,i}.
Omar Andrés Rosada González
2020년 9월 25일
Sudhakar Shinde
2020년 9월 25일
Can you share sets, n_disc, data and A.
Mohammad Sami
2020년 9월 25일
What is the size of A and data and contents in data{i}
Sourabh Kondapaka
2020년 11월 2일
Can you share the variables that are being used in your code as a .mat file ?
To save variables in workspace to a .mat file, refer this link
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!