Intersection between fittetfunction and line
Show older comments
Data = readtable('Data.xlsx','Range','A1:S9','VariableNamingRule','modify');
R = sqrt(3) * 267.1;
x = Data.Frequenz;
ZL = Data.MessungZLInOhm;
ZC = Data.MessungZCInOhm;
ZLR = Data.RL;
ZCR = Data.RC;
figure
plot(x,ZL,'rx')
axis([0 1000 0 1000])
xlabel('f in Hz')
ylabel('Z in \Omega')
grid on
hold on
[curveZL] = fit(x,ZL,'poly1');
h1 = plot(curveZL,'r--')
plot(x,ZC,'bx')
[curveZC] = fit(x,ZC,'power1');
h2 = plot(curveZC,'b--')
plot(x,ZLR,'gx')
[curveZLR] = fit(x,ZLR,'poly2');
h3 = plot(curveZLR,'g--')
plot(x,ZCR,'mx')
[curveZCR] = fit(x,ZCR,'power2');
h4 = plot(curveZCR,'m--')
h5 = plot([0 1000], [R R],'c-')
h = legend([h1 h2 h3 h4 h5],{'$Z_L$','$Z_C$','$Z_{LR}$','$Z_{CR}$','$\sqrt(3)R$'});
set(h,'Interpreter','latex','fontsize',10)
hold off
I need to find the intersection between the plots "Z_L and sqrt(3) R aswell with Z_C" i know that shouldnt be that hard. but all answers i find are to complex and do more then i asked or work only for functions i enter. As a absolute matlab beginner i am in way over my head and already had big problems with fitting a curve to 1/x since the most fitting answers i found was with polyfit.
Now all my functions look like i want to and i need to find the intersections. And if possible mark them with a horrizontel line and a point on the x-axes. for example "f_L" at the intersection with Z_L and the line.
Please excuse my bad english and if didn't express my self clearly. If you see something in my code that you would do differently, i am always open to advice.
Greatings
Accepted Answer
More Answers (0)
Categories
Find more on Polynomials in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!