how to define a matrix element in matlab

4 次查看(过去 30 天)
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]

采纳的回答

Matt J
Matt J 2022-9-29
编辑:Matt J 2022-9-29

更多回答(2 个)

Torsten
Torsten 2022-9-29
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 2022-10-2
To learn how to do this and other very basic things, invest two hours here:

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by