CSE 432 Fall 2019 Lab 7

November 15, 2019

Task 1 More Symbolic Algebra %Lab 7 Task 1 close all; clear; clc; syms x y; %y=x^2+5*x+6; figure fplot(‘x^2+5*x+6’,[-50 50]) figure ezpolar(‘cos(x)’) figure ezpolar(‘2+cos(x)’) figure ezpolar(‘sin(x)+cos(x)’) figure ezplot(‘cos(x)’) Task 2 Laplace Transform and Inverse Laplace Transform %Lab 7 Task 2 close all; clear; clc; syms t a s; y=exp(-a*t); pretty(laplace(y)) y1=exp(3*t); pretty(laplace(y1)) pretty(laplace(heaviside(t))) y2=exp(3*t)+exp(-5*t); pretty(laplace(y2))

Continue Reading

CSE 432 Fall 2019 Lab 6

November 11, 2019

Task 1 Symbolic Algebra in Matlab Solving Single Variable Equation Solving Multi Variable Equation Solving Simultaneous Equation Using roots and polyval function Using expand function to expand algebraic expression Using simplify function to simplify algebraic expression using factor function to factorize algebraic expression %Lab 6 Task 1 close all clear clc a=solve(‘3*x-50=0’); disp(a) b=solve(‘3*x^2+5*x-3=0’); pretty(b)

Continue Reading

CSE 432 Fall 2019 Lab 5

November 11, 2019

Task 1 Complex Numbers in matlab %Lab 5 Task 1 close all clear clc j=sqrt(-1); x=5+3j; y=6-2j; z=x+2*y; %Decomposing the real and imaginary part of a complex number disp(real(z)); disp(imag(z)); %Finding polar form of a complex number.\ disp(abs(z)); disp(angle(z)); Task 2 Real and Imaginary Components of complex numbers. %Lab 5 Task 2 close all clear

Continue Reading

CSE 432 Fall 2019 Lab 4

October 15, 2019

Task 1 Generation of unit impulse function. close all clear clc fs=10; a=1; t=-5:1/fs:5; impl=zeros(1,length(t)); for i=1:length(t) if t(i)==0 impl(i)=a; end end figure plot(t,impl) ylim([0 2]) figure stem(t,impl) Task 2 Generation of unit Ramp function. close all clear clc fs=10; a=1; t=-5:1/fs:5; rmp=zeros(1,length(t)); for i=1:length(t) if t(i)>=0 rmp(i)=t(i); end end figure plot(t,rmp) figure stem(t,rmp) Task

Continue Reading

CSE 432 Fall 2019 Lab 3

October 11, 2019

Task 1 Plotting a sine curve close all clear clc freq=input(‘Freqiuency of Sine function= ‘); amp=input(‘Amplitude of Function= ‘); phi=input(‘Initial Phase of Sine Function= ‘); time=input(‘End Time for Signal= ‘); fs=freq*10; %Following nyquist critereon t=0:1/fs:time; w=2*pi*freq; y=amp*sin(w*t+phi); figure(1) plot(t,y) figure(2) stem(t,y) Task 2 Plotting a cosine curve close all clear clc freq=input(‘Freqiuency of Cosine function=

Continue Reading

CSE 432 Fall 2019 Lab 2

September 26, 2019

Task 1 Introduction to for loop %Use of for loop close all clear clc n=input(‘Number of inputs= ‘); if (n>0) for i=1:n r=input(‘radius= ‘); area=pi*r*r; circ=2*pi*r; fprintf(‘Radius= %g\tArea= %g\tCircumference= %g\n’, r, area, circ) end else fprintf(‘ERR:Number must be Positive\n’); end %Task for students %Change the code such that if the radius is negative, it will

Continue Reading