how to define a matrix element in matlab

3 Ansichten (letzte 30 Tage)
marwa hajji
marwa hajji am 29 Sep. 2022
Beantwortet: Image Analyst am 2 Okt. 2022
any help please , I need to replace the first colunm in matrix with diffrent size by another value!!!
as example :
input
A=[1 2; 3 4];
B=[5 6; 7 8; 9 1; 1 4];
Output
B=[1 2; 3 4 ;9 1; 1 4]

Akzeptierte Antwort

Matt J
Matt J am 29 Sep. 2022
Bearbeitet: Matt J am 29 Sep. 2022

Weitere Antworten (2)

Torsten
Torsten am 29 Sep. 2022
A=[1 2; 3 4];
B=[5 6; 7 8; 9 1; 1 4];
B(1:2,1:2) = A;
B
B = 4×2
1 2 3 4 9 1 1 4

Image Analyst
Image Analyst am 2 Okt. 2022
To learn how to do this and other very basic things, invest two hours here:

Kategorien

Mehr zu MATLAB 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!

Translated by