Stacking Matrices One after Another to make a final matrix
조회 수: 15 (최근 30일)
이전 댓글 표시
Hello,
I have different matrices( each matrix has size of 2x4 ) stored in a file as a cell array, I am adding them together with the following code:
I have also attached the file and the pictures with the question.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350402/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350405/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/350408/image.jpeg)
for i =1:1:(size(Identify_3,1)-1)
Final_Matrix = [Identify_3{i, 1}{1, 3};Identify_3{i+1, 1}{1, 3}]
end
The problem is I am not getting correct results.
Does anybody know...?
댓글 수: 0
채택된 답변
Cris LaPierre
2020년 8월 23일
Does this do what you want?
step1 = vertcat(Identify_3{:})';
step2 = vertcat(step1{:})
I noticed that, because some of the values are imaginary, all numbers in the combined matrix will have an imaginary component, though some of them are just 0i.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!