Finding the first intersection point between 2 lines
Mostrar comentarios más antiguos
Hello all,
I need to find the time constant for which I plotted a line at y = 63% of the maximum value (y_max)
The other line comes from a Simulink model in which I can switch between different parameters, the output (y) differs every time (the line isn't plotted from a function). I'm using the following code which uses the 'interp1' function:
y_tau = 0.63*y_max;
[y,idx] = unique(y);
t = t(idx);
t_constant = interp1(y,x,y_max)
However, this always gives the second intersection point in the graph (see picture below). In this particular case:
t_constant = 190.2194
. How can I get the first intersection point using this code or any other method? Thank you in advance.
Respuesta aceptada
Más respuestas (2)
Categorías
Más información sobre Specialized Power Systems en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
