Changing a specific value in a matrix
61 次查看(过去 30 天)
显示 更早的评论
Quick question :)
Have searched all over for a solution to this problem.
I would like to change a value in a matrix, it could as little as a 3x5 matrix for instance.
I request a x,y input where i would want a function to change the value (it could be from 0 to 1 or 9) in the matrix (2,4 for instance). I have found plenty of solutions where you change all the 0's to 1's but not a specific target.
Thanks in advance
0 个评论
采纳的回答
Mahdi
2013-4-26
Let your data be in matrix A, and x,y are the indices where you want to change the value
A(x,y)=2 %2 is just a random number I chose.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!