How to do this addition?
古いコメントを表示
D = [60,600,15];
A(2) = D(2); -> OUTPUT OF A LOOKS LIKE A = [0,600]
B(3) = D(3); -> OUTPUT OF B LOOKS LIKE B = [0,0,15]
c = A + B;
disp(c);
How to make length of A as 3 and fill in zeros where the index is not used
採用された回答
その他の回答 (1 件)
Ameer Hamza
2018 年 5 月 27 日
Make A same size as B
A = [A zeros(1, length(B)-length(A))]
and then add
C = A+B;
カテゴリ
ヘルプ センター および File Exchange で Scope Variables and Generate Names についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!