CSE 432 Spring 2019 Lab 3

February 10, 2019

Task 1 Plotting a Sine Graph % Sine curve close all clear clc fs=20; %Sampling frequency in hz. Sampling time is 1/fs f=1; %frequency of sine wave is 30 hz phi=-pi/4; % initial phase w=2*pi*f; %Omega(angular velocity) a=2; %amplitude t=0:1/fs:2*pi; y=a*sin(w*t+phi); figure; plot(t,y); figure; stem(t,y); //Another way % Sine curve close all clear clc fs=1;

Continue Reading

CSE 432 Spring 2019 Lab 2

January 28, 2019

Task 1 String input output. Adding a variable in an array. %Task 1 clear; clc; var={}; n=input(‘Number of inputs: ‘); for i=1:n x=input(‘Enter String: ‘, ‘s’); var=[var x]; end for i=1:n fprintf(‘%s\n’, var{i}); end Task 2 Create a Matlab Script to find the cgpa of n subjects, where n will be taken as input. All

Continue Reading