Different size matrix data addition

5 ビュー (過去 30 日間)
Joydeb Saha
Joydeb Saha 2020 年 5 月 20 日
コメント済み: Walter Roberson 2020 年 5 月 20 日
I have different matrix size for different data file. say one data is 846x399 and another is 4208x399. I need to add all the files. how to do it?

回答 (1 件)

DEEPAK SHARMA
DEEPAK SHARMA 2020 年 5 月 20 日
Define your Matrix A(846x399) , B(4208x399)
Define C = zeros(1,399);
A = [A;repmat(C,3362,1)];
new Matrix A will be 4208x399
now you can add A and B
  1 件のコメント
Walter Roberson
Walter Roberson 2020 年 5 月 20 日
Might as well just do
A(size(B,1), end) = 0;

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by