I'm getting an error (Index in position 1 exceeds array bounds)
Mostra commenti meno recenti
I'm trying to find the onset point of a transient signal by comparing it with a threshold value calculated based on the base-level of this signal. However, when I try to find the index of such a point it returns and index out of bounds, I can't figure out why. Here's my code
signal = maximum_env_ch2; % 65536x2 array (time, voltage)
max_thresh = max(signal(1:floor(0.3*end),2)); %threshold calculated form the first part of the signal (zero-level)
ind_out = find( signal > max_thresh ,1); %find index of point>thresh
onset = signal(ind_out,1); %return onset time
Risposta accettata
Più risposte (1)
Davide Masiello
il 5 Ott 2022
Do this instead
ind_out = signal(1,:) > max_thresh; %find index of point>thresh
onset = signal(ind_out,1); %return onset time
Categorie
Scopri di più su Matrix Indexing in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!