필터 지우기
필터 지우기

WHAT IS ROW CONCATENATION AND COLUMN CONCATENATION WITH EXAMPLES AND APPLICATION?

조회 수: 2 (최근 30일)
%% ROW AND COLUMN CONCATENATION WITH EXAMPLES

채택된 답변

Image Analyst
Image Analyst 2015년 7월 5일
Try this:
% Row concatenation
m = magic(4) % 2D matrix
anotherRow = randi(9, 1, 4) % Some row to concatenate.
m = [m;anotherRow]
% Column concatenation
m = magic(4) % 2D matrix
anotherCol = randi(9, 4, 1) % Some col to concatenate.
m = [m, anotherCol]
  댓글 수: 2
Sombaran Gupta
Sombaran Gupta 2015년 7월 5일
anotherRow = *randi(9, 1, 4) % Some row to concatenate. can you explain this line of code
Image Analyst
Image Analyst 2015년 7월 5일
편집: Image Analyst 2015년 7월 5일
A row is a list of numbers all in one horizontal line. The randi() function creates such an array with random numbers. If you want you can use [3,5,14,432] or whatever other numbers you want. I just used 4 random numbers as an example. You can look up how randi() works in the help. If this answers your question, you can mark it as "Accepted" or else you can wait for other answers.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by