Unable to perform assignment because the size of the left side is

3 ビュー (過去 30 日間)
Alex Devereaux
Alex Devereaux 2021 年 5 月 20 日
コメント済み: Alex Devereaux 2021 年 5 月 21 日
I am trying to pull rows from different matrices and add them to one matrix but I am not sure of the syntax to do this correctly.
What I have at the moment is as follows...
data1(1,:) = PAR1rs(1,:)
data1(2,:) = PAR3rs(1,:)
data1(3,:) = PAR4rs(1,:)
data1(4,:) = PAR5rs(1,:)
data1(5,:) = PAR6rs(1,:)
But it returns the following error...
Unable to perform assignment because the size of the left side is 1-by-61492 and
the size of the right side is 1-by-60522.

採用された回答

Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 5 月 20 日
The error is clearly saying that the size matrices do not match. data1 must be a 5x60522 matrix.
  3 件のコメント
Abdolkarim Mohammadi
Abdolkarim Mohammadi 2021 年 5 月 20 日
MATLAB cannot handle jagged arrays. You should use cell arrays instead. For example:
data1 = cell (5, 1);
data1{1} = PAR1rs(1,:);
.
.
.
Alex Devereaux
Alex Devereaux 2021 年 5 月 21 日
Thank you.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by