Borrar filtros
Borrar filtros

Select positive samples in a matrice

3 visualizaciones (últimos 30 días)
Miguel Albuquerque
Miguel Albuquerque el 25 de Jul. de 2022
Respondida: dpb el 25 de Jul. de 2022
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 comentario
Matt J
Matt J el 25 de Jul. de 2022
Your code does not use "k" anywhere, so the intention is not clear.

Iniciar sesión para comentar.

Respuesta aceptada

dpb
dpb el 25 de Jul. de 2022
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...

Más respuestas (0)

Categorías

Más información sobre Startup and Shutdown en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by