Code:
%% Plotting The Semi Circle %%
%% Equation %%
%% After solving we came to know that r=wn %%
w_n=2.57;
r=w_n;
%% a is the angle which is 22 degrees %%
a=22;
x=(r*cos(a));
y=(r*sin(a));
%% Final Plot %%
j=plot(x,y,'b')
%% Axis Limit Setting
axis([-3 1 -3 3])
%% Setting Line width
set(j,'LineWidth',3)

 Réponse acceptée

Voss
Voss le 10 Juin 2022
I'm not sure where a equals 22 degrees comes from. That semicircle corresponds to an angle of 90 degrees to 270 degrees.
Setting a to a vector like 90:270 gives you a semicircle (and use cosd and sind since the angle is in degrees rather than radians).
%% Plotting The Semi Circle %%
%% Equation %%
%% After solving we came to know that r=wn %%
w_n=2.57;
r=w_n;
%% a is the angle which is 22 degrees %%
% a=22;
a = 90:270;
% x=(r*cos(a));
% y=(r*sin(a));
x = r*cosd(a);
y = r*sind(a);
%% Final Plot %%
j=plot(x,y,'--g'); % '--g' to get a dashed green line
%% Axis Limit Setting
% axis([-3 1 -3 3])
axis([-r-1 1 -r-1 r+1]) % "axes limits should be 1 unit greater than the r ..."
%% Setting Line width
set(j,'LineWidth',3)

2 commentaires

Waqas Shah
Waqas Shah le 10 Juin 2022
Thank you very much
infact a comes from the sin inverse of damping factor for a specific Transfer function as "Theta" is eaual to sine inverse of that damping factor.
Anyways thanks agian ....
Voss
Voss le 10 Juin 2022
You're welcome!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by