How to find the maximum deviation between x-values, given one y-value on a plot.

4 views (last 30 days)
I want to find the maximum difference between x-values (Temperature) between both curves. The same temperature variable is used for both curves to calculate Output Voltage at 0:1:100.
For instance, I want to find the Output Voltage that produces the maximum temperature difference. I want to print that Voltage and the respective temperature values from each curve for that y-value, on the screen.
Thanks.

Answers (1)

Matt J
Matt J on 15 Nov 2021
Edited: Matt J on 15 Nov 2021
Perhaps as follows,
F1=griddedInterpolant(OutputVoltage1, Temperature);
F2=griddedInterpolant(OutputVoltage2, Temperature);
Vmax=fminbnd(@(V) -abs(F1(V)-F2(V)), 0 ,100)
Temperature1=F1(Vmax)
Temperature2=F2(Vmax)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Tags

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!