(New page: == CODE SHOWN BELOW: == ''clc; close all; clear all; x1 = input('Please enter the x(t) vector with brackets: '); x2 = input('Please enter the h(t) vector with brackets: '); length_x1=...)
 
Line 1: Line 1:
== CODE SHOWN BELOW: ==
 
  
 
''clc;
 
close all;
 
clear all;
 
 
x1 = input('Please enter the x(t) vector with brackets: ');
 
 
x2 = input('Please enter the h(t) vector with brackets: ');
 
 
length_x1=length(x1);
 
 
length_x2=length(x2);
 
 
X1=[x1,zeros(1,length(x1))];
 
 
X2=[x2,zeros(1,length(x2))];
 
 
    for a=1:length_x1+length_x2-1
 
        y(a)=0;
 
      for b=1:length_x1
 
          if(a-b+1>0)
 
            y(a)=y(a)+X1(b)*X2(a-b+1);
 
          else
 
          end
 
      end
 
    end
 
   
 
fprintf('This give us the output:'); y''
 
  
  
 
== COMPARISON ==
 
== COMPARISON ==
 
Matlab's "conv" function works in a similar fashion to the above code.
 
Matlab's "conv" function works in a similar fashion to the above code.

Revision as of 11:11, 1 July 2009


COMPARISON

Matlab's "conv" function works in a similar fashion to the above code.

Alumni Liaison

has a message for current ECE438 students.

Sean Hu, ECE PhD 2009