Effacer les filtres
Effacer les filtres

How to set threshold to trigger for start and stop finding max value?

3 vues (au cours des 30 derniers jours)
Chen Kevin
Chen Kevin le 17 Avr 2020
Commenté : Chen Kevin le 19 Avr 2020
Hi all,
I am measuring flowing particles with a system. The particle will start to induce a pulse signal once it just enters the sensing zone, and the max amplitude can be obtained around the center of the zone.
What I have considered method by used for and if function is :
  1. Set a threshold for switch on and switch off record the data
  2. Once the amplitude (y>threshold) which means the cell just enter the sensing zone, start the search
  3. When the amplitude (y<threshold) which means the cell almost leave the zone, stop searching
  4. Find the max value from this recording time interval
  5. Also get the time interval
However, I am quite fresh in MATLAB so don't know how to write down them...
Thanks if someone can help me design this tool!

Réponse acceptée

Image Analyst
Image Analyst le 17 Avr 2020
Can you post a diagram, plot, image, data or anything to help illustrate your situation?
Otherwise, just try find:
indexEnters = find(y > threshold, 1, 'first'); % Index when particle enters and signa becomes big enough.
indexLeaves = find(y > threshold, 1, 'last'); % Index when particle leaves and signa becomes small again.
  7 commentaires
Image Analyst
Image Analyst le 19 Avr 2020
Modifié(e) : Image Analyst le 19 Avr 2020
xline() was introduced in r2018b. You can replace it with line():
line([ts(starts(k)), ts(starts(k))], ylim, 'Color', 'g', 'LineWidth', 2);
If anymore happen, just delete the line that threw an error. Most of them are just for making fancy graphics anyway.
I'll edit your post to add your Product on the right hand side of this page.
Chen Kevin
Chen Kevin le 19 Avr 2020
Thanks! Closer now, but how about get the max amplitude at each wave sets?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Extend Testing Frameworks dans Help Center et File Exchange

Produits


Version

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by