Select positive samples in a matrice

2 次查看(过去 30 天)
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);

采纳的回答

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