How do i replace numbers from one matrix with numbers of another matrix?
2 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Star Strider
2015-2-3
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.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!