Posts

Showing posts from February, 2021

FAMILIARIZATION OF SCIENTIFIC COMPUTING

Image
  OBJECTIVE ·    To familiarize different functions for scientific computing with examples   LEARNING OUTCOMES ·    After the completion of this experiment students will be able to execute small scripts using different arithmetic functions   SOFTWARE USED:                  MATLAB ® R2017a THEORY The different arithmetic functions of MATLAB are listed below. Y = abs( X ) returns the  absolute value  of each element in array X. If X is complex, abs(X) returns the  complex magnitude . abs - Absolute value and complex magnitude angle - Phase angle complex - Create complex array isreal - whether array is real real - Real part of complex number sinc – returns an array, y, whose elements are the  sinc  of the elements of the input, x. imag - Imaginary Part of Complex Number sin – Sine of argument in radians cos - cos of argument in radians 1. Type the following in the command window, write down the results and the functions of these built in modules (a

Coin Toss and Level crossing problem

Image
  OBJECTIVE To understand and explore random process simulation   LEARNING OUTCOMES After the completion of this experiment students will be able to Simulate random processes and their statistics   SOFTWARE USED:                  MATLAB ® R2017a 1. Simulate a coin toss that maps a head as 1 and tail as 0. 2. Toss the coin N = 100, 500,1000, 5000 and 500000 times and compute the probability (p) of head in each case. 3. Compute the absolute error |0.5 − p| in each case and plot against N and understand the law of large numbers. 4. Create a uniform random vector with maximum magnitude 10, plot and observe. 5. Set a threshold (VT = 2) and count how many times the random function has crossed VT . 6. Count how many times the function has gone above and below the threshold. PROGRAM   clc; clear all; close all; n=[10 100 500 1000 5000 10000 500000];   for i=1:7     heads=0;     tail=0;     disp('value of n is')     disp(n(i)) for cointoss=