Hope to gather last rows from each submatrices
이전 댓글 표시
I hope to gather last lines from each submatrix.
- I have 17 x 20 submatrices in matrix name A.
- Each submatrices have different number of lines, but same number of columns (total 7 columns, all)
- I tried to generate a file, made up of only last rows of each submatrices. My target file's from will be
M = [column1 column2 column3 column4 column5 column6 column7]
% made up of last rows of each submatrices, unknown number of
lines, 7 columns
- So I tried
for x_cc = 1:20
for y_cc = 1:17
M = A{x_cc, y_cc}(end,:);
end
end
- But it is not working, giving the error Subscript indices must either be real positive integers or logicals.
- Should I need to define the size first? What operation should be done? or what commands are useful? I tried cellfun, but not sure how can I use here.
- Need any help to solve this situation. Thanks~!
댓글 수: 5
Walter Roberson
2012년 11월 6일
Did you accidentally define a variable named "end" ?
Walter Roberson
2012년 11월 6일
In the output, should it first go down the first column of submatrices of A, or across the first row of submatrices of A ?
exsonic
2012년 11월 6일
Walter Roberson
2012년 11월 6일
Stack in what order? If your A is
P Q
R S
then do you want the last lines in the order
P
Q
R
S
or in the order
P
R
Q
S
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!