MATLAB ezplot3绘制三角函数曲线和loglog函数曲线

% Create the plot using the parametric functions 
% x = cost(t), y = sin(t), and z = sin(5*t) for -pi < t < pi 
figure 
ezplot3('cos(t)', 'sin(t)', 'sin(5*t)', [-pi pi])

MATLAB ezplot3绘制三角函数曲线和loglog函数曲线_第1张图片

% Create a set of values for the damping factor 
zeta = [0.01 .02 0.05 0.1 .2 .5 1]; 

 

% Define a color for each damping factor 
colors = ['r' 'g' 'b' 'c' 'm' 'y' 'k']; 

 

% Create a range of frequency values equally spaced logarithmically 
w = logspace(-1, 1, 1000); 

 

% Plot the gain vs. frequency for each of the seven damping factors 
figure 
for i = 1:7 
a = w.^2 - 1; 
b = 2*w*zeta(i); 
gain = sqrt(1./(a.^2 + b.^2)); 
loglog(w, gain, 'color', colors(i)) 
hold on 
end 

 

% Set the axis limits 
axis([0.1 10 0.01 100]) 

 

% Add a title and axis labels 
title('|G|(\omega) vs \omega') 
xlabel('\omega') 
ylabel('|G|(\omega)') 

 

% Turn the grid on 
grid on

MATLAB ezplot3绘制三角函数曲线和loglog函数曲线_第2张图片

你可能感兴趣的:(可视化,MATLAB可视化,数据可视化,matlab,开发语言)