0% found this document useful (0 votes)
9 views

MATLAB_ K24AS11_Tutorial 6(content+question) (1)

Matlab language

Uploaded by

muskan Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views

MATLAB_ K24AS11_Tutorial 6(content+question) (1)

Matlab language

Uploaded by

muskan Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

MATrix LABoratory (MATLAB)

Tutorial-6

Calculus for Engineers (K24AS11)

Department of Applied Sciences

KIET GROUP OF INSTITUTIONS, DELHI NCR, GHAZIABAD


INTRODUCTION

MATLAB stands for Matrix Laboratory. It is a high-performance language that is used for technical
computing. It was developed by Cleve Molar of the company MathWorks.Inc in the year 1984. It is
written in C, C++, Java. It allows simple calculation, Array (matrix) manipulations, plotting of
functions, implementation of algorithms and creation of user interfaces.

Getting Started with MATLAB

It is both a programming language as well as a programming environment. It allows the computation


of statements in the command window itself.

• Command Window: In this window one must type and immediately execute the
statements, as it requires quick prototyping. These statements cannot be saved. Thus, this
can be used for small, easily executable programs. It is indicated by the command
prompt(>>). Then using upward key for editing previous command.

• Command History window: This window displays a log of statements that you run in the
current and previous MATLAB sessions. The Command History lists the time and date of
each session in the short date format for your operating system, followed by the statements
from that session.

• Workspace: In this window the values of the variables that are created in the course of the
program (in the editor) are displayed.

• Editor (Script): In this window one can execute larger programs with multiple statements,
and complex functions These can be saved and are done with the file extension ‘.m ‘

• MATLAB Library comes with a set of many inbuilt functions. This library is the vast
collection of tools for computational algorithms of trigonometrical, complex
arithmetic, matrix computation, eigen value and eigen vectors, Bessel function,
Fourier transform, backpropagation, fuzzy, genetic algorithm and many more.
Although MATLAB is encoded in C, C++ and Java, it is a lot easier to implement than these
three languages. It provides an easier alternative for vector operations. It can perform only
one command instead of multiple statements as in other programming language.
Basic Functions in MATLAB

Function Description

The values or the text printed within single quotes is displayed on the
disp()
output screen

clear To clear all variables

close all To close all graphics window

clc To clear the command window

exp(x) To compute the exponential value of x to the base e

abs(x) To compute the absolute value of x

sqrt(x) To compute the square root of x

log(x) To compute the logarithmic value of x to the base e

log10(x) To compute the logarithmic value of x to the base 10

rem(x, y) To compute the remainder of x/y

sin(x) To compute the sine of x (x in radians)

sind(x) To compute the sine of x (x in degree)

cos(x) To compute the cosine of x (x in radians)

cosd(x) To compute the cosine of x (x in degree)

tan(x) To compute the tangent of x (x in radians)

atan2(x, y) To compute the arctangent or inverse of y/x

Predefined constant values

pi The π number, π = 3.14159 . . .

i,j The imaginary unit i, √ −1

Inf The infinity, ∞

NaN Not a number

Operators (arithmetic)

Operations such as addition, subtraction, multiplication and division can be done using a single
command instead of multiple loops

+ Addition
- Subtraction
* Multiplication
/ Division
^ Power
‘ Complex conjugate transpose
KIET Group of Institutions, Delhi – NCR, Ghaziabad
Department of Applied Sciences
B.Tech. I SEM
Tutorial No: 6, (2024-25)
MATLAB (Calculus for Engineers (K24AS11))

Q. No. Questions CO BL

Compute the following in the command window of MATLAB


(i) 12321+14341=_______
1 (ii) 437-789=_____________ 3
(iii) 45*76=__________
(iv) 78 = _______
(v) Approximate value of 1/73 = ________

2 1 1 1
Evaluate 23+5 + 4 × 5 , in the command window of MATLAB 3

If two sides of right triangle have lengths 31 and 45, evaluate the length of
3 3
the hypotenuse using the command window of MATLAB

4 If you get 5% interest-rate (yearly) on a loan, compounded monthly, and you 3


start with $1000, how much money will you have after 20 years?
Calculate the length of hypotenuse of triangle with angle 30 degree, and
5 sides with lengths 10cm and 20 cm. [ using MATLAB trigonometric 3
functions (cos, sin, tan)]

6 Calculate sin(π/4) and e10, using commands in MATLAB 3

Calculate the length of hypotenuse of triangle with angle 60 degree, and


sides with lengths 20 cm and 30 cm. [ using MATLAB trigonometric
7 functions (cos, sin, tan)] [HINT: c2=a2+b2-2abcosC] 3

8 If a=3+2i, b=5-i then evaluate Sum=a+b; diff=a-b; mult=a*b; dv=a/b 3

Type pi at a command prompt without a semicolon. How many significant


9 2
digits are displayed?

What MATLAB demos are available for demonstrating features of the


10 2
MATLAB language?

You might also like