i am having matrix of i rows by 3 columns ,now i want to multiple only i rows of 1 columns with 5 upto 100th row after the 100th row ,values has to be as it is.
1 次查看(过去 30 天)
显示 更早的评论
i= 3560 A = (i,3)
now want to multiple A(i,1) with some value say 5 but upto say 100 and then remaining values of rows has to be same.
and want to save New A(i,1) (change) with 1 to 100 i.e multiplied with 5 and remaining unchanged values in New A(i,1)
0 个评论
采纳的回答
Manan Mishra
2018-1-11
Let's assume that you want to multiply the first 'x' rows of the first column with a scalar 'n' and update the values in 'A'.
You can use the following command to do this:
>> A(1:x,1) = n*A(1:x,1);
If you want to do this for multiple columns (say first y columns) at once, you can do similar operation by indexing into columns also:
>> A(1:x,1:y) = n*A(1:x,1:y)
0 个评论
更多回答(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!