Hi, I have one set of data that I need to compare it with different size of data. So, as it stated in this code below, the threshold will be 3, 3.5, 4, 4.5 ….. I have to compare each threshold with all available data in variable GtrecMRCG2 then get its index. after all data compared, I need to check it with remaining threshold in variable thresholdVAR.
I wrote this based on my understanding. but it doesn't work because the dimension is mismatched. Thank you so much and big appreciation to those who want to give me advises. 🙂
threshold = 3;thresholdVAR=[threshold 0 0 0 0 0 0 0 0];GtrecMRCG2= [ 5 8 9 6 2 5 2 4 6 3 8 9 11];for ii=1:9 thresholdVAR(ii+1:end)= thresholdVAR(ii)+ 0.5; endfor idxm=1:length(thresholdVAR)for idxn = 1:length(GtrecMRCG2)idxalarmMRCG (1:length(thresholdVAR),1:length(GtrecMRCG2))= find(GtrecMRCG2(idxm,idxn)>=thresholdVAR(idxm,idxn));endend
Best Answer