Change all matrix elements from x to 1/x
25 次查看(过去 30 天)
显示 更早的评论
Hello, i am trying to change all the elements in a single line matrix from Xj to 1/Xj. Thanks
0 个评论
采纳的回答
更多回答(1 个)
Asieh Daneshi
2020-4-25
A=rand(n);
A(:,n)=1./A(:,n);
1 个评论
Walter Roberson
2020-4-25
This would change a single column, rather than a single line (row). It happens to change the last column, by the way.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!