Tutorial and Exercise - 1

Embed Size (px)

Citation preview

  • 8/12/2019 Tutorial and Exercise - 1

    1/2

    Tutorial (T)and laboratory exercise (E) on MATLAB

    T1. For any given matrix A of dimension M*N having real valued elements only, try commands A'{transpose of A} and A(:) {transfomation of a matrix to column vector}. Analyze the outcomes.

    T2.For any arbitrary finite size vector B of dimension N*1, try commands A*B {matrix-vectorproduct} and B.*B { vector dot product}. Verify that outcome of commmands B*B' and B'*B are

    not same.

    T3. For any array C {column vector or row vector} try commands size (C) and sum (C).

    T4.For a finite size matrix A, try sum (A), mean (A) and diag (A).

    T5.Logical testing { relational and logical operators}and looping , try following samle modules

    T5.1 clear allx=5;y=6;

    if (x ==5)disp ('equality verified');

    end

    T5.2 if ( (attendance >= 0.90) & (grad_average >=6) )pass = 1;

    else

    fail = 1;

    end;

    T6.Let a given array is x = [ 4 3 8 9 2];

    >> [array index ] = sort (x)

    T7. Plots and graphsTry following module

    clear all>> x = 0: pi/200: 2*pi;

    signal_1 = sin (x*10);signal_2 = sin (x*10) + cos (x*15);

    plot (signal_1);

    hold on;plot (signal_2);

  • 8/12/2019 Tutorial and Exercise - 1

    2/2

    Also explore uses of command s xlabel, ylabel, grid etc.

    T8. Explore purpose of commands clear all and close all.

    E1. Using commands ones (1, N) and zeros (1, N), stem generate and sketch the sequences; unitsample, unit step, delayed unit sample, delayed unit step for finite fixed delay M where, N>M.

    E2. Generate and plot each of the following sequences over the stated interval, also estimate theaverage power and total energy for each of these

    a. x(n) = 2 (n+2) (n-4), -5 n 5.

    b. x(n) = n [u(n)- u(n-10)] +10 exp(-0.3(n-10) ). [u(n-10)- u(n-20)], 0 n 20. .

    E3. Create functions for addition and multiplication operations on a given finite length sequences.

    E4. Verfiy the CAD (Commutative, Associative, and Distributive) properties on all three kinds ofamplitude and time transformations operation on a given finite length sequence.

    E5.Design a MATLAB function to decompose a given finite length sequence, x(n), into its evenand odd components. Sketch all three sequences.