This preview shows pages 1–2. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: 1 X<4.0 2 4.0X<4.2 3 4.2X<4.4 4 4.4X 2. The following MATLAB program will generate and plot a cosine waveform with its histogram. Run the program and explain why the histogram of the cosine wave looks the way it does. Print your plot and submit it with the answer. ME 365 PRE-LAB EXERCISE FOR LABORATORY 4 FALL 2011 2 clear all ; clc; A = 3; % signal amplitude w = 3*2*pi; % signal frequency (rad/s) T = 5; % maximum plot time (s) N = 400; % number of points to plot t = 0:T/N:T-T/N; % time vector y = A*cos(w*t); % cosine signal figure(1) subplot(2,1,1) plot(t,y); %plot the signal xlabel( 'Time (s)' ); ylabel( 'Signal' ); grid on ; NumBins = 20; subplot(2,1,2) hist(y,NumBins); % plot the histogram xlabel( 'Bins' ); ylabel( 'Point Count' ); grid on ;...
View Full Document
- Fall '07