Lecture 6
Lecture 6
FACULTY OF ENGINEERING
DEPARTMENT OF MINING, CHEMICAL & PETROLEUM ENGINEERING
BACHELOR OF SCIENCE IN CHEMICAL ENGINEERING
Course Code and Name: SCE 2202 COMPUTING FOR CHEMICAL ENGINEERING II
Course Level: YR II, SEM II (2023/2024)
Course Credit: 3 CU
Lecturer: Dr. Dan Egesa
Assisting Lecturer: Joshua Ocoun (Eng.)
Its interface and use is however more sophisticated than Excel Visio basic.
Basics
With the basics we learn to feed in equations for example;
b = 2
c = 3
a = b + c
When this is fed into the interface, Matlab understands that the value of b added to the value of c
will give the value of a, and will indicate the solution.
The same applies to various other equations as we shall see further.
For matrices,
An array A of a 3by1 (m x n) matrix can be written as,
A = [ i j k ], i,j,k representing a values ( 1,2,3,4,…..).
NOTE: for any given, matrix array, do not close the bracket until you have finished using inputting
all the rows and columns e.g..
𝑖 𝑗 𝑘
𝐵 = [ 𝑙 𝑚 𝑛] = [𝑖 𝑗 𝑘; 𝑙 𝑚 𝑛; 𝑜 𝑝 𝑞](in matlab)
𝑜 𝑝 𝑞
Matlab will recognize, that it’s a matrix array. If they are two matrices, B and C, once both are
defined, matrix D = B + C can be obtained.