Finding a range in an array
이전 댓글 표시
I have an array of 8000 values. I want to find a range of particular values say for example the values which are between 20 - 25.6 should be multiplied by -1 but the values should be in changed in the same array. I am currently using a the find nested in an if but somehow I cannot store it in the same array.
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2019년 5월 27일
0 개 추천
Let A - your array.
Anew = A.*(1 - 2*(A >= 20 & A <= 26.5));
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
