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

CL2014 MATLAB Programming Lec01 B

This document provides an overview of a MATLAB programming course. The course objectives are to introduce programming fundamentals in MATLAB and demonstrate its use for data analysis and solving engineering problems. The course contents cover MATLAB environment, arrays, plots, functions, logic/conditional statements, GUI, file I/O. Assessment includes classwork, quizzes, assignments, term project and final exam. Lab work practices MATLAB commands and expressions.

Uploaded by

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

CL2014 MATLAB Programming Lec01 B

This document provides an overview of a MATLAB programming course. The course objectives are to introduce programming fundamentals in MATLAB and demonstrate its use for data analysis and solving engineering problems. The course contents cover MATLAB environment, arrays, plots, functions, logic/conditional statements, GUI, file I/O. Assessment includes classwork, quizzes, assignments, term project and final exam. Lab work practices MATLAB commands and expressions.

Uploaded by

Umar
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

CL2014

MATLAB Programming

Lecture: 01
Week: 01

Course Instructor
Engr Muhammad Umar Khan Niazi
Office: C1-21, Ext.: 218, Email: [email protected]
1
2 Course Objectives

1. Fundamentals of programming and introduction to MATLAB.

2. Enable students to present the results in tabular and


graphical form by using MATLAB.

3. Demonstrate the use of MATLAB for data analysis.

4. Practice the programing of basic Civil Engineering Problem in


MATLAB and be able to use the MATLAB for the solution of
engineering problems.
3 Course Learning Outcome (CLO)
 To DEVELOP programs in MATLAB for application in civil
engineering

Assessment Policy
 Classwork (Tutorials) 7 35
 Quizzes 2 10
 Assignments 1 5
 Term Project 1 10
 Final Exam 1 40
4 Weekly Course Contents
Course Contents:

Week Topics to be covered Chapter CLO


1 Introduction to MATLAB environment, Menus and Toolbar, basic 1
arithmetic commands, local and global variables.

2 m-Files, MATLAB help system, Scaler arithmetic operations, 1


Commands for managing the work session T1

3 Built in functions, Introduction to arrays and array operations, 1

4 Two dimensional arrays 1


T2
5 Two dimensional array applications in Civil Engineering T3

6 Sessional - I
5 Weekly Course Contents
7 Introduction to 2D and 3D plots in MATLAB 1
Q1
8 Creating 2D and 3D plots in MATLAB, Formatting of plots in MATLAB 1
T4
9 Creating a GUI in MATLAB 1
T5
10 Logical Operators and Functions 1
A
11 Conditional Statements, if statements, for loops, while Loops, 1

12 Conditional Statements, if statements, for loops, while Loops 1


T6
13 User defined functions in MATLAB 1
Q2
14 I/O data file handling in MATLAB 1
T7
15 Application of MATLAB for solution of advanced level problems. 1
P
16 FINAL EXAM
6 Introduction

 MATLAB is derived from MATH LABORATORY


 This software package is specially created for scientific and
engineering numerical computations developed by Mathworks
7 MATLAB Environment, Menus and Tool bar
8 MATLAB Calculator
9 Rounding Operations
The following list of operations can be used to convert real
numbers into integers:
 round(a) Rounds a using the standard rounding rules.

 ceil(a) Returns the nearest integer greater than or equal to a.

 floor(a) Returns the nearest integer smaller than or equal to a.


10 MATLAB Local Variables

 Most of the time we interact with


local variables in MATLAB
 In
this example A, B, C and a are local
variable

 N OTE: variable are case sensitive. ‘A’


and ‘a’ are not same
11 Lab Work Practice

1. Using only the MATLAB Command Window, find out what the
command imagesc does.
2. Demonstrate by using several values of angle θ that:
 sin2(θ) + cos2(θ) = 1

3. Use one MATLAB line to evaluate the expression below:


12 Lab Work Practice

5. Evaluate the following MATLAB expressions by hand. Rewrite


t hem using parenthesis and use MATLAB to check the
answers.
a. 2 / 2 * 3
b. 6 - 2 / 5 + 7 ^ 2 – 1
d. 3 ^ 2 / 4
e. 3 ^ 2 ^ 2

6. Convert the temperature from °F to °C using following formula


°F = °C × (9/5) + 32
13 Lab Work Practice

Use one MATLAB line to evaluate the expression below;


Power Formula P=W/t
Newton’s Second Law F = ma
Weight Formula W=mg
Pressure Formula P=F/A
Kinetic Energy Formula E = 1/2 mv²

You might also like