find largest magnitude in array
조회 수: 15 (최근 30일)
이전 댓글 표시
A=[-0.1;1;-5;-0.8;-0.4];
tto=find(A == max(abs(A)))
tt=find(A ~= max(abs(A)))
I want to find index of largest magnitude in array and put it in 'tto'.
And put rest indices in tt
result should be
tto=3
tt=[1;2;4;5]
댓글 수: 0
채택된 답변
gonzalo Mier
2019년 5월 9일
편집: gonzalo Mier
2019년 5월 9일
A=[-0.1;1;-5;-0.8;-0.4];
tto=find(abs(A) == max(abs(A)))
tt=find(abs(A) ~= max(abs(A)))
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Fixed-Point Matrix Operations in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!