Outputting information from a loop

Any ideas as to output all combinations of i and j. Each combination is a vector of size 9*1. Table 2 is a cell array.
for i=1:4
for j=1:4
C=Table2(i,j);
axes_mat=vertcat(C{:});
D=cell2mat(axes_mat);
D=reshape(D,[9,1]);
end
end

댓글 수: 3

Jan
Jan 2022년 4월 5일
Please post some input data and explain, what you want as output. Currently we see your code, but what is your question?
RP
RP 2022년 4월 5일
I have attached Table 2. This is a cell array with 16 cells each with dimensions 1*1*9.
I need to take the same element from each array (e.g. the second entry) and construct a matrix of dimensions 9*16
RP
RP 2022년 4월 5일
The output should be a matrix as opposed to a cell array.

댓글을 달려면 로그인하십시오.

답변 (1개)

Jan
Jan 2022년 4월 5일

0 개 추천

What about:
D = cat(2, Table2{:});

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

질문:

RP
2022년 4월 5일

댓글:

RP
2022년 4월 5일

Community Treasure Hunt

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

Start Hunting!

Translated by