Replace Values Larger than Threshold with New Value, But Keep Smaller Values
73 次查看(过去 30 天)
显示 更早的评论
Hi all,
I have a 600 x 2 matrix, and I would like to check which values within the first column exceed a threshold. For example, I would like to replace all values that exceed 180 with that number minus 250 (e.g. 270 would be replaced with 20 because 270 - 250 equals 20). However, I would like to keep the values that are below 180 the same. In essence, I'm trying to keep the original order established by the original matrix, but I just need to replace those values greater than 180 with new values. Any hints? (This should be really easy, and I'm sure I'll find a solution eventually, but right now my stress isn't helping me see clearly.)
Thanks in advance!
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!