How to find distance on discrete graph
1 次查看(过去 30 天)
显示 更早的评论
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 个评论
Rik
2021-6-5
You could try a linear interpolation of the two points before and after the intersection.
回答(1 个)
Manas Minnoor
2021-6-5
Hey Itzik,
Please refer to the following documentation, it may be what you're looking for.
Hope this helps.
0 个评论
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!