6
Department of EEE Course: DSP lab (EEE 312) Lab Report 1 Submitted to: Haider Adnan !an "roup members: #ate! $o!ammed id: %21123%33 A&mi aisar id: %2112213%

DSP_Lab_1

Embed Size (px)

DESCRIPTION

very nice

Citation preview

Department of EEECourse: DSP lab (EEE 312)Lab Report 1

Submitted to: Haider Adnan Khan

Group members:Fateh Mohammed id: 021123033Awmi Kaisar id: 021122130

Ques.1: Write a MATLAB script to calculate N! = 1.2.3.4. N where N is a user input.clcclear allclose all

n=input('enter value of n:');s=1;for(i=1:n) s=s*i;ends

Result:enter value of n:4

s =

24

>>

Ques.2: Write MATLAB function that will calculate the volume and surface area of a cube from its edge length. [Hint: Edge Length = x; Volume = x3 surface area = 6x2]

function [ v,a ] = volume_and_area( x )v=x^3;a=6*x^2;end Result:

>> [ v,a ] = volume_and_area( 3 )

v =

27

a =

54

>>

Ques.3: . Write MATLAB script to plot 10sin(x), 5sin(2x) and 2sin2(x) for 0