how to define a matrix element in matlab

조회 수: 3 (최근 30일)
marwa hajji
marwa hajji 2022년 9월 29일
답변: Image Analyst 2022년 10월 2일
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