how to define a matrix element in matlab

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]

 Respuesta aceptada

Más respuestas (2)

Torsten
Torsten el 29 de Sept. de 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 el 2 de Oct. de 2022

0 votos

To learn how to do this and other very basic things, invest two hours here:

Categorías

Más información sobre Get Started with MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 29 de Sept. de 2022

Respondida:

el 2 de Oct. de 2022

Community Treasure Hunt

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

Start Hunting!

Translated by