Weird Behavior Of Replacing Data Array In a Certain Range ...

1 ビュー (過去 30 日間)
Tyann Hardyn
Tyann Hardyn 2021 年 12 月 18 日
編集済み: Tyann Hardyn 2021 年 12 月 21 日
Hi, Community
I want to ask about how to delete array data with a certain range. So i have this code below :
the_noising_gauss_ori = vertcat(transpose(noising_gauss_ori)); %Other related variable was sucessfully linked
mov_remove_gauss_ori_pos = the_noising_gauss_ori >= 2; %Other related variable was sucessfully linked
mov_remove_gauss_ori_neg = the_noising_gauss_ori <= -2; %Other related variable was sucessfully linked
detecting_noise_pos = the_noising_gauss_ori < 2; %Other related variable was sucessfully linked
detecting_noise_neg = the_noising_gauss_ori > -2; %Other related variable was sucessfully linked
gaussian_filter = imgaussian(graph_gauss_ori, zigm, [l_wak 1]); %Other related variable was sucessfully linked
if ~isempty(mov_remove_gauss_ori_neg) || ~isempty(mov_remove_gauss_ori_neg)
the_original_sinyal2(detecting_noise_pos) = nan;
the_original_sinyal2(detecting_noise_neg) = nan;
the_original_sinyal1(mov_remove_gauss_ori_pos) = gaussian_filter(mov_remove_gauss_ori_pos);
the_original_sinyal1(mov_remove_gauss_ori_neg) = gaussian_filter(mov_remove_gauss_ori_neg);
end
When i run that code, the variable array of the_original_sinyal1(mov_remove_gauss_ori_pos) and the_original_sinyal1(mov_remove_gauss_ori_neg) is good, it can be replaced with its relative data from gaussian_filter(mov_remove_gauss_ori_pos) and gaussian_filter(mov_remove_gauss_ori_neg).... How ever, the variable array of the_original_sinyal2(detecting_noise_pos) and the_original_sinyal2(detecting_noise_neg) cannot filter the data with that range (the_noising_gauss_ori < 2 or the_noising_gauss_ori > -2) and just shown as NaN data for all of the_original_sinyal2 variable....
How to fix my problem, anyone. I just want to replace the_original_sinyal2 variable with a same rows as the_noising_gauss_ori < 2 or the_noising_gauss_ori > -2 as NaN.... Thank you very much...

採用された回答

Voss
Voss 2021 年 12 月 18 日
編集済み: Voss 2021 年 12 月 18 日
Any (real) number is either less than 2 or greater than -2 (or both). Therefore detecting_noise_pos | detecting_noise_neg is all true. Hence, the_original_sinyal2 is all NaN after doing this:
the_original_sinyal2(detecting_noise_pos) = nan;
the_original_sinyal2(detecting_noise_neg) = nan;
  6 件のコメント
Tyann Hardyn
Tyann Hardyn 2021 年 12 月 21 日
編集済み: Tyann Hardyn 2021 年 12 月 21 日
May Allah Bless You, It Works, Sir, Thank you so much.

サインインしてコメントする。

その他の回答 (0 件)

Community Treasure Hunt

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

Start Hunting!

Translated by