Aqua Phoenix
     >>  Lectures >>  Matlab 3  
 

Navigator
   
 
       
   

3.4 Assignment Solutions - Lecture 3

3.4.1 Part A

  hw3partA.m  

3.4.2 Part B

  hw3partB.m  
snd=[];
r=8000;
l=0.01;
for f=1000:100:2000
  snd=[snd, sin(2 * pi * f / r * [0:r * l])];
end
for f=2000:-100:1000
  snd=[snd, sin(2 * pi * f / r * [0:r * l])];
end
snd=[snd,snd,snd,snd,snd];
wavplay(snd, 8000);
Figure 3.18
Click image to enlarge, or click here to open

3.4.3 Part C

  hw3partC.m  
grad=[];
for i=1:256
  for j=1:256
    grad(i,j,1)=i;
    grad(i,j,2)=j;
    grad(i,j,3)=255 - (i-1);
  end
end
image(uint8(grad));
Figure 3.19
Click image to enlarge, or click here to open

3.4.4 Part D

  hw3partD.m