WHAT IS ROW CONCATENATION AND COLUMN CONCATENATION WITH EXAMPLES AND APPLICATION?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Sombaran Gupta
am 5 Jul. 2015
Bearbeitet: Image Analyst
am 5 Jul. 2015
%% ROW AND COLUMN CONCATENATION WITH EXAMPLES
0 Kommentare
Akzeptierte Antwort
Image Analyst
am 5 Jul. 2015
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 Kommentare
Image Analyst
am 5 Jul. 2015
Bearbeitet: Image Analyst
am 5 Jul. 2015
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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!