You are on page 1of 11

LAB REPORTS

SUBMITTED TO:
NUMERICAL
Engr. Dr. Zeeshan Sarwar

SUBMITTED BY:
METHOD
SULAIMAN KHAN

REG NO:
MATLAB 21-TE-08

Lab#1
LAB REPORT
DATE: 3-11-2022
Lab#1
CHAPTER 2: MATLAB Fundamentals
Arrays, Vectors, and Matrices:
In This lab we learnt about Arrays, Vectors, and matrices in MATLAB
LAB TASK:
1. Assigned a row vector.
2. Secondly we formed a column vector by separating the elements with “;”.
3. Take transpose of our row matrix by “’”.
4. In fourth command we formed a matrix of order 3x3 by separating rows by using “;”.
5. We used built in commands of matlab.

RESULT:
The Colon Operator:

It is a powerful tool for creating and manipulating arrays. Colon is used to separate two numbers,
MATLAB generates the numbers between them using an increment of one:

1. Colon generates the numbers between them using an increment of one.


2. Colons are used to separate three numbers, MATLAB generates the numbers between
the first and third numbers using an increment equal to the second number.
3. Negative increments are made.
RESULT:
CONCLUSION:

In this lab we learnt the basics of MATLAB. We got to know about problem solving and
communication, through learning to use this software. We learnt to give commands to MATLAB
and different built in functions.
Lab#2

CHAPTER 3: Programming with


MATLAB

EXAMPLE 3.1: Develop a script file to compute the velocity of the free-falling bungee
jumperfor the case where the initial velocity is zero.
TASK :
EXAMPLE 3.2: As in Example 3.1, compute the velocity of the free-falling bungee
jumper butnow use a function file for the task.
TASK:

EXAMPLE: Computes the mean and the standard deviation of a vector and name
the file asstats.m.
LAB 3
M-FILE OF QUIZ

LAB 4

QUESTION: Give output of the following code:


1)sin (x)^2+2*x+3
2) x^2+2*+3
ANSWER:
LAB #5
CHAPTER 4: Roundoff and
Truncation Errors
EXAMPLE 4.1:
This code is set up to evaluate the Maclaurin series expansion for e^x
TASK :

EXAMPLE 4.5 :

Problem Statement:
we use a centered difference approximation of O(h2 ) to estimate the first
derivative of the following function at x = 0.5,
f (x) = −0.1x4 − 0.15x3 − 0.5x2 − 0.25x + 1.2
Perform the same computation starting with h = 1.
TASK:
END.

You might also like