Finding the value of x for a corresponding known y value for a curve

1 Ansicht (letzte 30 Tage)
I have a code for temperature against time step. The time step is dt and temperature is ucn. I used the plot function to plot ucn against dt. I have to find the first value of dt where the temperature crossess the y=143 or y=142 line. i need the value of dt wherever it crosses first

Akzeptierte Antwort

Matt J
Matt J am 13 Apr. 2021
Bearbeitet: Matt J am 13 Apr. 2021
find(diff(sign(ucn-143))~=0,1) + 1
  2 Kommentare
Atheeb Amjard
Atheeb Amjard am 13 Apr. 2021
thank you very much Matt J, would you mind explaining the code if possible
Matt J
Matt J am 13 Apr. 2021
You're quite welcome. Please Accept-click the answer to indicate that a solution to your question was reached.
The code just looks for the first occurence where ucn-143 changes sign, i.e., when diff(sign(ucn-143))~=0.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by