Add value at new position automatically to matrix
4 ビュー (過去 30 日間)
古いコメントを表示
Hello there, following problem:
I have a matrix A. For an algorithm a value should be added in the last place of a new row and column, rest filled with 0. I tried this in B but the result should look like in C. Is there an easy way to do this without manually adding an additional column and row?
Thank you very much!
A = [1 2 3;4 5 6]
B = {A 0;0 1}
C = [1 2 3 0;4 5 6 0;0 0 0 1]
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!