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

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.

回答(1 个)

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)

类别

在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息

产品

版本

R2018b

标签

编辑:

2021-11-15

Community Treasure Hunt

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

Start Hunting!

Translated by