- 37
- 0
- 约2.47万字
- 约 39页
- 2019-09-04 发布于安徽
- 举报
实用标准文档
文案大全
Matlab Worksheet 2
Part A (In-class room exercises)
Using plot to display the following voltage with appropriate line type, title and labels. Also present the graph with suitable ranges of axis.
where f=50 Hz.
(Hint: time interval must be small enough, e.g. 0.001 seconds. Therefore, t=0:0.001:1 is appropriate);
Answer:
Home_work_2_A_1.m
%lbs in-class-exercise1_1 2013/8/21
%function Using plot to display the following voltage with appropriate line type, title and labels. Also present the graph with suitable ranges of axis.
% v(t)=220sin(2??ft)
% where f=50 Hz.
%Comment/loop
clear all;
close all;
t=0:0.001:1;
v=220*sin(2*pi*50*t);
plot(t,v,m,LineWidth,2)
xlabel(t(sec))
ylabel(v(voltage))
title(v(t)=220sin(2??ft))
axis([0 0.2 -260 260]);
grid on;
Using plot to display the following voltage with appropriate line type, title and labels. Also present the graph with suitable ranges of axis.
where f=50 Hz.
In addition, on the same graph, draw the envelope of the oscillation and add legends.
Answer:
home_work_2_A_2.m
%lbs in-class-exercise1_2 2013/8/21
%function Using plot to display the following voltage with appropriate line type, title and labels. Also present the graph with suitable ranges of axis.
% v(t)=220exp(-5t)cos(2??ft)
% where f=50 Hz.
% In addition, on the same graph, draw the envelope of the oscillation and add legends.
%Comment/loop
clear all;
close all;
t=0:0.001:1;
v=220*exp(-5*t).*sin(2*pi*50*t);
plot(t,v,m,LineWidth,2);
xlabel(t(sec))
ylabel(v(voltage))
title(v(t)=220exp(-5t)cos(2??ft))
hold on;
v1=220*exp(-5*t);
plot(t,v1,b,LineWidth,2);
hold on;
plot(t,-v1,b,LineWidth,2);
hold off;
legend(the oscillation, the envelope of the oscillation);
axis([0 1 -220 220]);
grid on;
Use subplot, draw a 2 by 2 array of plots for the following functions:
Apply appropriate line type, title, labels and axis ranges for the graphs.
Answer:
home_work_2_A_3.m
%lbs in-class-exercise1_3 2013/8/21
%function Use subplot, d
原创力文档

文档评论(0)