matlab programs

© All Rights Reserved

18 views

matlab programs

© All Rights Reserved

- Matlab Intro 1
- Matlab 1
- Structural Dynamics Design
- Multilinear Algebra
- Lec10 Infinite Dimension Vector Spaces
- Simulink Tutorial DaSilva V1
- Comm Ch06 Signal Space En
- Image Restoration
- Gid Data code
- Solucion Taller 2 2 2016 2S
- 142_Luenberger.pdf
- Mat Lab Basics
- report
- Visualization for Finite Element Method Education
- Fcla Draft Solutions
- Paper III – Mathematics Syllabus UPTU
- Matlab Electrical Example.pdf
- 3D Matlab Model User Manual
- Mat Lab Tutorial
- Control Systems Plab1

You are on page 1of 24

PRACTICAL FILE

SUBMITTED

BY:NISHANTKUMAR

MAE-B

INDEX

S.NO NAME OF

EXPERIMENT

1.

2.

3.

4.

5.

6.

7.

8.

9.

Introduction to

matlab.

Basic matrix

operations.

Plot and solve

various

functions

Basic 2-D and

3D plots.

To find closed

loop transfer

function of

system

To generate sine

wave,cosine

wave and

exponential

curve.

Plot the transfer

function

Open loop

transfer

function

To find root

locus for given

system.

PAGE DATE OF

DATE OF

REMARKS

NO.

EXPERIMENT SUBMISSION

12/08/14

19/08/14

19/08/14

26/08/14

26/018/14

2/09/14

2/09/14

9/09/14

9/09/14

16/09/14

16/09/14

23/09/14

23/09/14

30/09/14

30/09/14

07/10/14

07/10/14

14/10/14

Experiment -1

Introduction to matlab

Matlab :

Stands for matrix laboratory

Can be used as a fancy calculator

Allows you to easily work with entire matrices rather than one number at a time

Is useful for anything that requires matrix and vector manipulation such as :

i) Mathematical, scientific, engineering ,statistical and financial problems

ii) Anything that requires plotting/visualizing and analyzing data

Comes with a basic set of tools for visualizing data for performing calculations on

matrices and vectors

i) for specific technologies , MATLAB provides toolboxes, which add to the basic

MATLAB functionality. We have the image processing toolbox.

Some other toolboxes include:

(1) statistics toolbox

(2) neural network toolbox

(3) fuzzy logic toolbox

(4) signal processing toolbox

(5) wavelet toolbox

(6) financial toolbox

(7) bioinformatics toolbox

(8) Database toolbox

Matlabs graphical interface is written in java and should be look similar on any OS. It is

divided into 4 main parts :

usually appear her too.

Workspace window as you define new variables,they should be listed here.

Command history window this is where past command are remembered .if you

want to re-run previous command or to edit it you can drag it from this window to

the command window or double click to re-run it.

Current directory window shows the files in the current directory.

The M-files

The edit command in the above section shows you a very basic M files for the

acosd

(a) M-Files are text with MATLAB code

(b) M files have a .m extension

SCALAR VARIABLES:

Scalars

In matlab a scalar is a variable with one row and one column. Scalars are the simple

variables that we use and manipulate in simple algebraic equations.

Creating scalars

To create a scalar you simply introduce it on the left hand side of an equal sign.

>>x=1;

>>y=2;

>>z=x+y;

Scalar operations

Matlab supports the standard scalar operations using an obvious notation. The following

statements demonstrate scalar addition, subtraction, multiplication and division.

>> u=5;

>>v=3;

>>w=u+v

>>x=u-v

>>y=u*v

>>z=u/v

Vectors:

In matlab a vector is a matrix with either one row or one column.the distinction berween

row vector and column vector is essential . many programming errors are causedby

using a row vector where a column vector is required ,and vice versa.

MATLAB vector are used in many situations, e.g,creating x-y plots, that do not fall under

the rubric of linear algebra. In these con texts a vector is just a convenient data

structure.

MATLAB still enforces the rules of linear algebra so paying attention to the details of

vector creation and manipulation is always important.

Creating vectors

To create a vector you simply introduce it on the left hand side of an equal sign. Of

course this means that the expression on the right side of the equal sign must evaluate

to a vector . There are numerous ways to actually create a vector, each one having

Advantages in particular situations.

Assigning a mathematical expressions involving vectors

Appending elements to a scalar

Using colon notation

Vector operations

Mathematical operations involving vectors follow the rules of linear

algebra. Addition and subtraction of vectors is performed with the +and

operators .

Addition and subtraction

Operations with scalars

Vector transpose

Vector multiplication

Element-wise vector operations

Passing vectors to built-in functions.

EXPERIMENT-2

AIM: BASIC MATRIX OPERATION

A= [1 2 0;2 5 -1;4 10 -1]

A=

1 2

0

2 5

-1

4 10 -1

B=A

B=

1 2 4

2 5 10

0 -1 -1

C= A*B

C=

5 12 24

12 30 59

24 59 117

Eig(A)

Ans=

3.7321

0.2679

1.0000

EXPERIMENT -3

1. Y(x)= sin(xcosx /x2 + 3x +1)

For the values of x from one to three step of 0.02.

x= 1:0.02:3;

g= x.*cos(x);

g= x.^2+ 3*x +1;

y= sin(f./g);

Y= x3 -3x2 + 2X

r= [1 -3 2 0];

c= roots(r);

Ans=[0,2,1]

3.

X= linspace(0,10,200);

g= x.^3+1;

h=x+2;

z= x.^2;

y= cos(x.*pi);

F=y*z./g*h;

X2 COSX/(X3+1)(X+2)

EXPERIMENT -4

AIM:BASIC 2-D AND 3-D PLOTS.

PROGRAM:

fplot('exp(-.l*x) . *sin(x) ', [0 , 20])

xlabel('x'),ylabel('f(x) ; e-{x/10} sin(x) ')

title('A function plotted with fplot')

> X = 0 : . l. : 2. 0 ;

y = exp(O.l*x) .*sin(x);

plot (x, y)

x1abel (I Time (t) in Sedorids1)

ylabel (I The Response Amplitude in mtn I)

title ( 1 A Simple 2 -D Plot 1 )

PROGRAM:

r = inline('1+2*(sin(2*t)).-2');

ezpolar(r)

default domain.

PROGRAM:

x = 't.*cos(3*pi*t) ';

y = 't.*sin(3*pi*t)';

z = 't ';

ezplot3(x,y,z)

EXPERIMENT-6

1.Program to generate sine wave

t=0:.0001:5;

y=sin(2*pi*f*t);

plot(t,y);

ylabel ('Amplitude');

xlabel ('Time Index');

TITLE ('Sine wave');

t=0:.0001:5;

y=cos(2*pi*f*t);

plot(t,y);

ylabel ('Amplitude');

xlabel ('Time Index');

TITLE ('cosine wave');

n=input('Enter the duration of the signal N = ');

a=input ('Enter the scaling factor a = ');

t=0:.1:n-1;

y=exp(a*t);

plot(t,y);

ylabel ('Amplitude');

xlabel ('Time Index');

TITLE ('Exponential Signal');

- Matlab Intro 1Uploaded byMahmoud Basho
- Matlab 1Uploaded byIchwan Setiawan
- Structural Dynamics DesignUploaded byAmrith Singh
- Multilinear AlgebraUploaded byJason Payne
- Lec10 Infinite Dimension Vector SpacesUploaded byZhe Li
- Simulink Tutorial DaSilva V1Uploaded bySiva Nanth
- Comm Ch06 Signal Space EnUploaded byGurpreet Singh
- Image RestorationUploaded bySrinath Kv
- Gid Data codeUploaded bydiv53
- Solucion Taller 2 2 2016 2SUploaded byKevin VG
- 142_Luenberger.pdfUploaded byshychang
- Mat Lab BasicsUploaded byMB Fazli Nisar
- reportUploaded byNishil Vijayan
- Visualization for Finite Element Method EducationUploaded bymy name
- Fcla Draft SolutionsUploaded byPablo Freeman
- Paper III – Mathematics Syllabus UPTUUploaded bychangu2011
- Matlab Electrical Example.pdfUploaded byUmair Ahmed
- 3D Matlab Model User ManualUploaded byGanesh Sooklal
- Mat Lab TutorialUploaded byMouhamadou Diaby
- Control Systems Plab1Uploaded byasad
- NFEM.Ch33 (2) (1)Uploaded byBogdan Chiriluta
- 121_EEE110_LabSheet01Uploaded bybkmmizan
- ResumeUploaded bytbogatchev
- Sylabus NdaUploaded byshubham721
- Reader 133AUploaded byIv Chen
- aimcet1.txtUploaded byAksh Roy
- Sample for Download3Uploaded bydraco_85
- e0-219-laa11-ex06Uploaded byChayan Ghosh
- 2001-04Uploaded bybhuan6
- mathgen-428310336Uploaded bySam

- 2013-15 ProposalUploaded byDivayChadha
- Nirma in AfricaUploaded byDivayChadha
- FireWALLUploaded byDivayChadha
- Sponsorship SlabsUploaded byDivayChadha
- Telecommunication PptUploaded byDivayChadha
- writing-technical-papers.pdfUploaded byletter_ashish4444
- Maths TestUploaded byDivayChadha
- Camber, CasterUploaded byforza_lcn
- Springs&Dampers Tech Tip 2Uploaded byOtavio Carvalho
- matlab ExperimentUploaded byDivayChadha

- logimath round1 questionsUploaded byapi-388519772
- L8_4Uploaded byKANTHAVEL T
- Handout Conditions for Stability and StationarityUploaded byKaligula G
- Fundamentals of Math 2Uploaded byBrian Cbtngn
- Chapter4 (2W) - Signal Modeling -Statistical Digital Signal Processing and ModelingUploaded byKhanh Nam
- Yearly Teaching Plan Mathematics 2008 Form 1Uploaded byOliver Dean
- Theory of Robust Control (Carsten Scherer)Uploaded byErsin Erol
- saaty1993Uploaded byCarito Standen
- Higher Engineering Mathematics by B.SUploaded byRenuka Sivamurugan
- year 5 judging maths standards student recordUploaded byapi-328064059
- Cauchy’s stress theorem—stress tensor-The state of stress at a point.pdfUploaded byonnly1964
- Lesson Plan_mcs 301Uploaded byjoydeep12
- Papers_Analysis of Two Partial-least-Squares Algorithms for Multivariate CalibrationUploaded by_Ririn_Adam_Ci_5450
- Web Work ecuacionesUploaded byAlexMelgar
- 2U MathsUploaded byRicky
- Chenmat ReportUploaded byPenny Gildo
- Book Solution Contemporary Abstract Algebra Joseph a Gallian Ch 9 11Uploaded bytt_aljobory3911
- Bochner’s Theorem on the Fourier Transform on RUploaded byEdgar Marca
- PIA B_Basic_Module 1.2 (MATHS) Algebra FinalUploaded byAhsan Malik
- RevisionUploaded byNadirah Halim
- HW2_SolnUploaded byJun Kang
- FORTRAN PROGRAMSUploaded byHorlarthunjiAzeez
- 8579ch25Uploaded byNikola Andjelic
- rphUploaded byFaizal ZaIn
- Basic Number TheoryUploaded byPercy Khan
- Appendix B ScalarorDotProduct FinalUploaded byzalziza
- Manifold[1]Uploaded bySmain Kouadik
- MarkovUploaded byPaulo Zuniga
- Laws of LogarithmsUploaded byKimberly Marasigan
- 2005nashequilibria-24Uploaded bybwklgmva