How to compare a value to a matrix and repeat the comparison after increasing the value
4 ビュー (過去 30 日間)
I am working on an algorithm that compare the vectors' peak locations with the average vector peak location and excluding vectors that their peaks are located over 10 Hz away from the average vector. The average vector peak then it will be included otherwise if the number of vectors included is less than 20 vectors then I should increase the difference in peak location by 10 Hz until it reaches or exceeds 20.
I am not able to create a loop that recompare (RA is the difference between peak locations in Hz) the peaks after increasing V from 10 Hz by 10 Hz every time until the number of vectors I1>=I.
Can you please help me create a loop the recompare RA with V (for k = find(RA<=V))
V=10; I=20; I1=0;
for k = find(RA<=V);
Anmol Dhiman 2020 年 6 月 17 日
Based on your explaination
% find number of elements that satisfy [array]<=B
numOfElements = length(find(array<=B));
% Check if they are greater than A