is there any way for me to apply code to a figure?

2 visualizzazioni (ultimi 30 giorni)
Hi i was given a assignment where i was asked to find the Damping ratio from a given figure which is attached i was also told that i had to use Matlab with the code below to find the root zeta but im not sure how i would do that. do i run the code with the figure? im lost on what to do. the error code i get when running the code says it does not recognize Nosc.
fun = @(zeta) (exp((-2*pi*zeta*Nosc)/(sqrt(1-zeta^2))) - Xn_div_X0 );
x0 = [0 1]; %Search bracket for zeta
options = optimset('Display','iter');
[zz, fval, exitflag, output] = fzero(fun,x0,options);

Risposte (1)

Matt J
Matt J il 6 Mar 2022
You can get the x and y data that make up the plot as follows.
h=findobj(gca,'Type','line')
x=h.XData;
y=h.YData;
I would imagine that would enable you to do the required analysis.
  3 Commenti
Matt J
Matt J il 6 Mar 2022
I don't know the formula for the damping ratio, but perhaps if you fit an appropriate curve to x,y you can extract it.

Accedi per commentare.

Categorie

Scopri di più su Programming in Help Center e File Exchange

Prodotti


Release

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by