how can i add column in matrix?

조회 수: 2 (최근 30일)
Mira le
Mira le 2019년 12월 22일
댓글: Mira le 2019년 12월 22일
A is a matrix:
0 9 8 4 6
9 0 8 4 3
0 6 4 8 9
8 0 4 6 9
9 0 8 4 3
0 9 4 8 6
9 0 8 4 6
how to add another column at the end of matrix A?

채택된 답변

Turlough Hughes
Turlough Hughes 2019년 12월 22일
Depends what you want in that column but you could for example add a column of zeros as follows:
A = [A zeros(size(A,1),1)]
  댓글 수: 1
Mira le
Mira le 2019년 12월 22일
I want to add a field of struct

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by