>> 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

답변 (1개)

Daniele Sonaglioni
Daniele Sonaglioni 2021년 5월 13일

1 개 추천

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

Daniele Sonaglioni
Daniele Sonaglioni 2021년 5월 20일
If this answer helped you, please accept it.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

질문:

2021년 5월 13일

댓글:

2021년 5월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by