필터 지우기
필터 지우기

Select positive samples in a matrice

조회 수: 2 (최근 30일)
Miguel Albuquerque
Miguel Albuquerque 2022년 7월 25일
답변: dpb 2022년 7월 25일
Hey guys, thanks in advance,
I have this azimuth_compressed_matrix, defined by freq_azimuth(frequency) x azimuth. However I want to define this matrix only for values of freq_azimuth>0. Basically , in this example, I want to make a way to make this code I made automatic, is there a way?
k=find(freq_azimuth>0);
freq_azimuth2=freq_azimuth(4000:7999);
azimuth_compressed_matrix2=azimuth_compressed_matrix(:,4000:7999);
  댓글 수: 1
Matt J
Matt J 2022년 7월 25일
Your code does not use "k" anywhere, so the intention is not clear.

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

채택된 답변

dpb
dpb 2022년 7월 25일
One more time, yet again, it's one of the most fundamental of MATLAB idioms/syntaxes that makes MATALB what it is -- <MatrixIndexingExample-Logical Indexing>
azimuth_compressed_matrix2=freq_azimuth(freq_azimuth>0);
Again, there's no need for find here...

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by