필터 지우기
필터 지우기

sort the values in a vector h(n)

조회 수: 2 (최근 30일)
ad lyn
ad lyn 2021년 12월 30일
댓글: Voss 2021년 12월 30일
with :
h(n)=[0.00275644015144904,0.00355792817060437,-0.00242358119135895,0.00221119427549373,-0.00231180739987265,0.0020388846972871]

채택된 답변

Voss
Voss 2021년 12월 30일
Look into sort and abs.
h=[0.00275644015144904,0.00355792817060437,-0.00242358119135895,0.00221119427549373,-0.00231180739987265,0.0020388846972871]
h = 1×6
0.0028 0.0036 -0.0024 0.0022 -0.0023 0.0020
sort(h)
ans = 1×6
-0.0024 -0.0023 0.0020 0.0022 0.0028 0.0036
sort(h,'descend')
ans = 1×6
0.0036 0.0028 0.0022 0.0020 -0.0023 -0.0024
sort(abs(h))
ans = 1×6
0.0020 0.0022 0.0023 0.0024 0.0028 0.0036
sort(abs(h),'descend')
ans = 1×6
0.0036 0.0028 0.0024 0.0023 0.0022 0.0020
  댓글 수: 4
ad lyn
ad lyn 2021년 12월 30일
편집: ad lyn 2021년 12월 30일
if As=[2,98,77777,565,-45885]
how to verify if i is included in As?
Voss
Voss 2021년 12월 30일

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Shifting and Sorting Matrices에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by