how i subtract a vector( 1*n-dim ) from columns of a matrix (n*n-dim) without uses for , end and orders likes these?
1 次查看(过去 30 天)
显示 更早的评论
i wish subtract a vector from columns of a matrix while my code is not great. example: a =
1 3
4 2
>> a-[1 2]= 0 1 3 0
0 个评论
采纳的回答
更多回答(1 个)
Joseph Cheng
2015-4-24
Look at the function repmat() to tile the vector to perform the matrix subtraction.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!