I need to isolate certain values of a matrix based on whether one of the values fall in a certain range
% ans = 2×2 % 24.9843526628176 32 % 5.44020124026728 62
function FINAL_OUTPUT = FFT_Output(OG_Audio, Filter_count, Min_peak_distance) % Setup Sectional_Length = round(length(OG_Audio)/4); BM_Filtered_Signal = (blackman(length(OG_Audio))).*OG_Audio; First_Filter_Parameter = ((1/(Sectional_Length/100))*ones(1,(Sectional_Length/100))); Word_section = cell(4,1); FFT_Word = cell(4,1); FINAL_OUTPUT = cell(4,1); for i = 1:4 % Word sections Word_section{i} = BM_Filtered_Signal(((Sectional_Length*(i-1))+1):(Sectional_Length*i)); % Moving average filter j=0; while(j<=Filter_count) Word_section{i} = filter(First_Filter_Parameter, 1, Word_section{i}); j=j+1; end % FAST FOURIER TRANSFORM FFT_Word{i} = abs(fft(Word_section{i},length(Word_section{i}))); FFT_Word{i} = FFT_Word{i}(1:(round(length(FFT_Word{i})/(2)))); % Peak detection [M,I] = findpeaks(FFT_Word{i}, "MinPeakDistance",Min_peak_distance, "MinPeakHeight",(0.1*max(FFT_Word{i}))); % Identifying peak frequencies for comparisons FINAL_OUTPUT{i} = [M,I]; end end
Here's a general approach - Discretize the data according to the groups and then split then into cells.
bins = 0:30:300; idx = discretize(data, bins) out = splitapply(@(x) {x}, data, idx)
Matlabsolutions.com provides guaranteed satisfaction with a
commitment to complete the work within time. Combined with our meticulous work ethics and extensive domain
experience, We are the ideal partner for all your homework/assignment needs. We pledge to provide 24*7 support
to dissolve all your academic doubts. We are composed of 300+ esteemed Matlab and other experts who have been
empanelled after extensive research and quality check.
Matlabsolutions.com provides undivided attention to each Matlab
assignment order with a methodical approach to solution. Our network span is not restricted to US, UK and Australia rather extends to countries like Singapore, Canada and UAE. Our Matlab assignment help services
include Image Processing Assignments, Electrical Engineering Assignments, Matlab homework help, Matlab Research Paper help, Matlab Simulink help. Get your work
done at the best price in industry.