Effacer les filtres
Effacer les filtres

How to modify settings for event detection in MATLAB?

1 vue (au cours des 30 derniers jours)
Sarah Ghosh
Sarah Ghosh le 28 Juin 2013
I am writing a code for event detection. However, I want to increase the region of convergence from zero to about 1e-4.For example, instead of checking for y(1)-10=0, I want to check for y(1)-10<1e-4. How can this be done?
  2 commentaires
Walter Roberson
Walter Roberson le 28 Juin 2013
Are you referring to event detection in the context of one of the ode*() routines?
Sarah Ghosh
Sarah Ghosh le 28 Juin 2013
Yes, it comes with the options parameter of ode*

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 28 Juin 2013
Return
y(1)-10 >= 1e-4
This will be false (0) when it is within 1e-4. Set the options so the crossing direction does not matter.
  3 commentaires
Walter Roberson
Walter Roberson le 1 Juil 2013
Return
double(y(1)-10 >= 1e-4)
Sarah Ghosh
Sarah Ghosh le 1 Juil 2013
Yes, it worked.... thanks a lot for the help....

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Programming dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by