how to define a matrix element in matlab
Show older comments
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]
Accepted Answer
More Answers (2)
A=[1 2; 3 4];
B=[5 6; 7 8; 9 1; 1 4];
B(1:2,1:2) = A;
B
Image Analyst
on 2 Oct 2022
0 votes
To learn how to do this and other very basic things, invest two hours here:
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!