graph won't appear

>> zi = 0.2; % define the value of damping coefficient
>> r = 0:0.05:10; % define the range of r
>> for i = 1; % length(r)
>> T(i) = sqrt(1+(4*(zi^2)*(r(i)^2))) / sqrt(((1-r(i)^2)^2)+(4*(zi^2)*(r(i)^2)));
>> end
>> plot (r,T); % plot T vs r

Respuestas (1)

Daniele Sonaglioni
Daniele Sonaglioni el 13 de Mayo de 2021

1 voto

Try this code. You have forgotten to specifay the indices in the for cicle
zi = 0.2; % define the value of damping coefficient
r = 0:0.05:10; % define the range of r
for i = 1:length(r); % length(r)
T(i) = sqrt(1+(4*(zi^2)*(r(i)^2))) / sqrt(((1-r(i)^2)^2)+(4*(zi^2)*(r(i)^2)));
end
plot (r,T); % plot T vs r

1 comentario

Daniele Sonaglioni
Daniele Sonaglioni el 20 de Mayo de 2021
If this answer helped you, please accept it.

Iniciar sesión para comentar.

Categorías

Más información sobre 2-D and 3-D Plots en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 13 de Mayo de 2021

Comentada:

el 20 de Mayo de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by