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!