graph won't appear

3 次查看(过去 30 天)
Gianne Ong
Gianne Ong 2021-5-13
>> 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
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

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by