How can I add a matrix into another matrix

조회 수: 3 (최근 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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by