How do i replace numbers from one matrix with numbers of another matrix?
2 views (last 30 days)
Show older comments
A = [1:1:5; 5:1:9; 9:1:13; 13:1:17; 17:1:21; 21:1:25;] B = [5:6:35; 27:-3:12; 55:5:80] I need to replace the numbers in the last 4 columns of the 1st and 4th rows of A with the last 4 columns of the 1st and 3rd rows of B.
0 Comments
Accepted Answer
Star Strider
on 3 Feb 2015
This works:
A([1 4], 2:5) = B([1 3], 3:6);
It could be made more general if necessary. This is specific because it is what you asked for.
More Answers (0)
See Also
Categories
Find more on Logical 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!