How to find distance on discrete graph
1 view (last 30 days)
Show older comments
Hi, here's my code :
close all
clear all
clc
f = [4454,3112,2423,2060,1773,1562,1352,1153,0923,0632,0152];
phase=[-75.7,-59.9,-44,-29.9,-15,0.1,17.3,30.39,45.20,59.68,73.9];
Vr= [0.636,0.989,1.127,1.520,1.661,1.732,1.661,1.449,1.166,0.777,0.183];
Vl=[1.857,1.945,2.001,1.985,1.874,1.686,1.390,1.046,0.663,0.297,0.016];
Vc=[0.177,0.444,0.795,1.111,1.440,1.682,1.865,1.945,1.935,1.854,1.752];
V=1.767766;
VrMax=[0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968,0.6928005968]
plot(f,Vr/V,'r');
hold on;
plot(f,VrMax,'b');
title('BnadPass Calculation');
xlabel('f');
ylabel('Voltage/V');
legend('Vr','VrMax/sqrt(2)');
grid on;
Here's the graph:
How can I find the distance between the cross points of the blue line and the red function? I cannot simply click on this points because I did not plot them and it is an approximation.
Basicly, I want to find out for which f values, the red graph equals 0.6928005968.
Thanks in advance.
1 Comment
Rik
on 5 Jun 2021
You could try a linear interpolation of the two points before and after the intersection.
Answers (1)
Manas Minnoor
on 5 Jun 2021
Hey Itzik,
Please refer to the following documentation, it may be what you're looking for.
Hope this helps.
0 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!