필터 지우기
필터 지우기

Dimensions of arrays being concatenated are not consistent.

조회 수: 2 (최근 30일)
Layla scbenski
Layla scbenski 2020년 10월 4일
답변: Ameer Hamza 2020년 10월 4일
Hello,
I appreciate your help.
I understand that the dimensions for each variable is different, the number of rows and columns in each variable is different therefore concatenating them won't work.
How do I fix that? How can I give the matrix (M) a dimension in which it's able to accomadate all the rows and cloumns of the variables
I have attatched a screenshot of the error and a part of the code.
Thank you in advance.

답변 (1개)

Ameer Hamza
Ameer Hamza 2020년 10월 4일
The cell array is made for such cases: https://www.mathworks.com/help/matlab/cell-arrays.html.
It works almost the same, except that it uses curly braces for initialization and indexing, and capable of holding any variable type
C = {m1, s1, ..};
C{1} % access first element: m1
C{2} % access second element: s1
..

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by