Posts

Simple Data Analysis with Spreadsheets

Image
  OBJECTIVE   To export signal values as .csv file, read and display it LEARNING OUTCOMES After the completion of this experiment students will be able to compute with exported data. SOFTWARE USED:                  MATLAB ® R2017a   1. Display cosine signal and export it as a .csv file. Read this .csv or .xls file as an array and plot it. Compute the mean and standard deviation of the signal. Plot its histogram with an appropriate bin size. PROGRAM   t=-10:0.01:10; s=cos(t); csvwrite(sprintf('F:\\exp_7\\My_File%d.csv'),s) M = csvread(sprintf('F:\\exp_7\\My_File%d.csv')) figure; plot(t,M);%plotting the read values figure; h = histogram(M); title('histogram plot') Avg= mean(M) std_deviation=std(M)   OUTPUT Avg =   -0.0548 std_deviation = 0.7212  

DATA VISUALISATION

Image
  OBJECTIVE To visualize the data in different ways LEARNING OUTCOMES After the completion of this experiment students will be able to plot data using scatter, boxplot, histogram, bar functions SOFTWARE USED:                  MATLAB ® R2017a 1. Plot a cosine signal added with random noise using scatter plot PROGRAM x = 0:0.01:10; len=length(x); y = cos(x) + rand(1,len); sz = 25; c = 0:0.01:10; scatter(x,y,sz,c,'filled') title('Scatter plot: Cosine signal added with a random noise') OUTPUT 2    2. Plot some random data using scatter plot PROGRAM x = rand(1000,1); y = rand(1000,1); s = scatter(x,y,[],'k'); OUTPUT 3. Plot the bar plot of the data y= [75 91 105 123.5 131 150 179 203 226 249 281.5] having values on the x axis as [1900:10:2000]. PROGRAM x = 1900:10:2000; y = [75 91 105 123.5 131 150 179 203 226 249 281.5]; bar(x,y) OUTPUT ...

Solution of ordinary differential Equation

Image
  OBJECTIVE To solve ordinary differential Equation LEARNING OUTCOMES After the completion of this experiment students will be able to solve   ordinary differential Equation SOFTWARE USED:                  MATLAB ® R2017a   1. Solve the first order differential equation With initial condition x(0)=1 Program syms x(t); eqn= diff(x,t)+ 2*x ==0; cond= x(0)==1; soln= dsolve(eqn,cond) t=0:0.05:10 s=subs(soln) plot(s) title('Response of firt order differential equation') xlabel('time') Output soln = exp(-2*t) 2. solve second order differential equation Program syms x(t) ; eqn= diff(x,t,2) + 2*diff(x,t) + 2*x   == exp(-t); soln= dsolve(eqn); soln=simplify(soln) OUTPUT soln =  exp(-t)*(C4*cos(t) + C5*sin(t) + 1)   3. Solve the differential equation cos(2*x)-y y(0)=1 y’(0)=0 PROGRAM syms y(x) Dy = diff(y); ode = di...

NUMERICAL DIFFERENTIATION AND INTEGRATION

Image
  OBJECTIVE To perform   numerical differentiation and integration LEARNING OUTCOMES After the completion of this experiment students will be able to Implement numerical integration and differentiation. SOFTWARE USED:                  MATLAB ® R2017a THEORY The first derivative of the function f(x), which we write as df /dx , is the slope of the tangent line to the function at the point x. To put this in non-graphical terms, the first derivative tells us how whether a function is increasing or decreasing, and by how much it is increasing or decreasing . The second derivative of a function is the derivative of the derivative of that function. We write it as   d 2 f /dx 2 . While the first derivative can tell us if the function is increasing or decreasing, the second derivative tells us if the first derivative is increasing or decreasing. If the second derivative is positive, th...