how to subtract from every element in an array
135 ビュー (過去 30 日間)
古いコメントを表示
I have a very large double array in which every element needs to have 300 subtracted from it due to a mis calibration how do i do this?
0 件のコメント
回答 (2 件)
Calum Yates
2015 年 11 月 3 日
2 件のコメント
Stephen23
2015 年 11 月 3 日
編集済み: Stephen23
2015 年 11 月 3 日
Try it and see! Your computer will not explode if you do a little experimentation:
>> [1,2;3,4] - 600
ans =
-599 -598
-597 -596
Or alternatively you could actually read the documentation for minus, which has an example of subtracting a scalar from a matrix, complete with the text "The scalar is subtracted from each entry of A."
Image Analyst
2015 年 11 月 3 日
Just a wild guess --- you didn't mean spatial calibration did you? Where your array (image) is misaligned and you want to shift it up, down, left, and/or right by 300 elements. If so, let me know.
By the way, you should respond as "Comments" rather than as a new independent "Answer" to your original question, unless your reply actually IS an answer to your original question.
参考
カテゴリ
Help Center および File Exchange で Logical についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!