How can I add a matrix into another matrix

2 ビュー (過去 30 日間)
Yixuan Zhang
Yixuan Zhang 2019 年 9 月 15 日
編集済み: Yixuan Zhang 2019 年 9 月 15 日
Hi, I am wondering of there is a function that enables me to insert a matrix B 1x5, into matrix A 16x5 and make matrix A become 17x5. Also can I use fprintf to make this output? Thanks.
  2 件のコメント
Yixuan Zhang
Yixuan Zhang 2019 年 9 月 15 日
編集済み: Yixuan Zhang 2019 年 9 月 15 日
If it is just number such as (1,2,3,4,5), and add those number into the end of matrix A, still make matrix A become 17x5, what should I do? Thanks.
madhan ravi
madhan ravi 2019 年 9 月 15 日
If that’s the case my answer would do what you want.

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

回答 (1 件)

madhan ravi
madhan ravi 2019 年 9 月 15 日
A = [A;B]
help fprintf
doc fprintf
  2 件のコメント
Image Analyst
Image Analyst 2019 年 9 月 15 日
In general, what if he wants to insert it, instead of append it?, like say insert it between rows 3 and 4?
madhan ravi
madhan ravi 2019 年 9 月 15 日
Ah , I completely missed that part. Star has answered that part.

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by