Borrar filtros
Borrar filtros

How to find specific x values of specific y value of a plotted graph?

48 visualizaciones (últimos 30 días)
Hi I am plotting a transfer function magnitude with respect to omega. I am trying to find cut off frequencies which are the 1/sqrt(2) values of magnitude plot. So in summary I want to find x values which f(x)= 1/sqrt(2) in the graph I plotted. And if possible I want to emphasize them (by marking, crossing etc.)
I tried to find intersection point between line y=1/sqrt(2) But couldn't find a precise result as well so a follow up question. Can I find the points which 2+ plot intersected ?
Here is my code and graph
y = linspace(0,50000,50001);
R=33*10^3;
C=10^-8;
H = @(y) (R./(R-(1j./(y.*C))));
figure;
subplot(2,1,1);
plot(y,abs(H(y)));
xlabel('\omega');
ylabel('|H(j\omega)|');
hold on;
yline(1/sqrt(2));

Respuesta aceptada

KSSV
KSSV el 2 de Jun. de 2021
Editada: KSSV el 2 de Jun. de 2021
y = linspace(0,50000,50001); % y values
R=33*10^3; % constant
C=10^-8; % constant
H = @(y) (R./(R-(1j./(y.*C)))); % function
val = abs(H(y)) ; % evaluate absolute function H values at y
vali = 1/sqrt(2) ; % the value of val (y-axes) at which y (x-axes_ to be sought
yi = interp1(val,y,vali) ; % do interpolation to get respective y-value ofr given vali
figure;
plot(y,val);
xlabel('\omega');
ylabel('|H(j\omega)|');
hold on;
yline(1/sqrt(2));
plot(yi,vali,'*r')
  4 comentarios
Utku Deniz Altiok
Utku Deniz Altiok el 2 de Jun. de 2021
Is there any more simpler method than interpolation? since its not a concept I am familiar with
KSSV
KSSV el 2 de Jun. de 2021
y = linspace(0,50000,50001); % y values
R=33*10^3; % constant
C=10^-8; % constant
H = @(y) (R./(R-(1j./(y.*C)))); % function
val = abs(H(y)) ; % evaluate absolute function H values at y
vali = 1/sqrt(2) ; % the value of val (y-axes) at which y (x-axes_ to be sought
yi = y(abs(val-vali)<10^-3) ; % Get the index in val where val == vali
figure;
plot(y,val);
xlabel('\omega');
ylabel('|H(j\omega)|');
hold on;
yline(1/sqrt(2));
plot(yi,vali,'*r')

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by