Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
3 views

Lecture_1_Matlab_Programming1

This document outlines a MATLAB programming course for first-semester students, focusing on algorithm prototyping, numerical computation, and graphical representation. The syllabus includes topics such as programming environment, graph plots, functions, control statements, and text manipulation. Recommended textbooks and examples of MATLAB expressions and vector manipulation are also provided.

Uploaded by

SANJEET KUMAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Lecture_1_Matlab_Programming1

This document outlines a MATLAB programming course for first-semester students, focusing on algorithm prototyping, numerical computation, and graphical representation. The syllabus includes topics such as programming environment, graph plots, functions, control statements, and text manipulation. Recommended textbooks and examples of MATLAB expressions and vector manipulation are also provided.

Uploaded by

SANJEET KUMAR
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Course :Matlab Class :

Sem-1

Lesson :Basic of Matlab


Programming

By :Goutam Sanyal
Why

• Rapidly prototype an algorithm before committing the


development resources to implementing the algorithm in
another language
• It integrates computation, visualization, and programming in
an easy-to-use environment where problems and solutions
are expressed in familiar mathematical notation.
Objective
• To learn programming using MATLAB
• Graphical representation
• Application to Numerical Computation
Syllabus

• Unit I- Introduction to Programming: Components of a computer, working


with numbers, Machine code, Software hierarchy
• Unit II- Programming Environment: MATLAB Windows, A First Program,
Expressions, Constants, Variables and assignment statement, Arrays.
• Unit III- Graph Plots: Basic plotting, Built in functions, Generating
waveforms, Sound replay, load and save.
• Unit IV- Procedures and Functions: Arguments and return values, M-files,
Formatted console input-output, String handling.
• Unit V-Control Statements: Conditional statements: If, Else, Else-if,
Repetition statements: While, for loop.
• Unit VI- Manipulating Text: Writing to a text file, Reading from a text file,
Randomising and sorting a list, searching a list.
• Unit VI- Manipulating Text: Writing to a text file, Reading from a text file,
Randomising and sorting a list, searching a list.
Books
• Text Book
• Getting started with matlab :A quick introduction to scientist
and engineer , Rudra Pratap
• An Introduction to Programming and Numerical Methods in
MATLAB , S.R. Otto and J.P. Denier
• Reference Books:
• MATLAB: An Introduction with Applications, by Amos Gilat,
2nd edition, Wiley, 2004,
• C.B. Moler, Numerical Computing with MATLAB, SIAM, 2004.
• Determine the value of the expression a(b +
c(c + d))a, where a = 2, b = 3, c = −4 and d =
−3.
• MATLAB statement to evaluate the expression:
• >> a = 2; b = 3; c = -4; d = -3;
• >> a*(b+c*(c+d))*a
Example Calculate the expressions: sin 60◦ (and the
same quantity squared), exp(ln(4)), cos 45◦ −sin 45◦,
ln exp(2+cos π) and tan 30◦/(tan π/4+tan π/3).

>> x = sin(60/180*pi)
x=
0.8660
>> y = xˆ2
y=
0.7500
>> exp(log(4))
ans =
4
Manipulating Vectors and Dot Arithmetic
Program

x = -3:0.2:3; % for(x=-3;x<=3;x=x+.2) cout<<x


y = x.^3+7*x-3; % y= x3+7x-3 in c++ y=pow(x,3)+7*x-3
grid on
plot(x,y)
Thank You

You might also like