LESSON 2.2 OCTAVE TUTORIAL (MATLAB): ROW VECTORS, ARRAYS, ADDITION OF VECTORS MATRIX
• Creating Row vectors use spacing ( ) or commas (,). Assign an alphabet to the row vector
K = [ 5 5 5]
L = [5,5,5]
• Creating Column vectors use semicolon (;) or transpose sign (‘). Assign an alphabet to the row vector
M = [5;5;5]
N = [5 5 5]’
• The colon notation is used in the definition of multirow matrices
R = [1:5]
S = [10:-2:4] % Start from 10 to end at 4 but the spacing of -2
• Display function
Disp (M)
M
To multiply element by element. To perform element-wise multiplication, (.*)is used. to perform element-wise addition, we would use (.+), subtraction( .-) and division (./). Remember that element-by-element operations can only be carried out on matrices of the same dimensions.
.+ .- .* ./ .^
• Scalar
2*M
2.*M
• Addition of the two vectors
M+N ………………%No error detected it only matters / is different for multiplication and division
M.+N
• Exponent vector / Power function
M^2 ……………. % error function = error: for x^y, only square matrix arguments are permitted and one argument must be scalar. Use .^ for elementwise power.
M.^2
• Multiplication of Vectors
M*N ……………. % error function = nonconformant arguments (op1 is 3x1, op2 is 3x1)
M.*N
M.*N’
• Division of Vectors
M/N ……………. % error function
M./N
M./N’
• Creating Matrix. 2x3 matrix. Use the row rule and the column rule mentioned above.
O = [ 2 2 1; -3 1 2] clc
• Creating Matrix. 3x3 matrix. Use the row rule and the column rule mentioned above.
P = [ 2 2 1; -3 1 2; 9 8 7]
• Matrix is broad and will be discussed in lesson 2.3
• Clear
• Clear all
• clc
-------------------------------------------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
Access Ready Information for you:
Octave, Coco Simulation, DWSIM Simulation
Octave:
1. Download Octave - • How To Download and In...
2. Lesson 1.1 - Octave Tutorial / Matlab Introduction to Octave • Lesson 1.1 - Octave Tu...
3. Lesson 1.2 - OCTAVE TUTORIAL (MATLAB): HELP FUNCTION, DISP FUNCTION, INPUT FUNCTION. link: • LESSON 1.2 - OCTAVE TU...
4. LESSON 2.1 - OCTAVE TUTORIAL (MATLAB): COMPLEX NUMBERS, TRIGONOMETRY, SQUARE ROOT • LESSON 2.1 -OCTAVE TUT...
5. LESSON 2.2 OCTAVE TUTORIAL (MATLAB): ROW VECTORS, ARRAYS, ADDITION OF VECTORS MATRIX • LESSON 2.2 OCTAVE TUTO...
6. LESSON 2.3 OCTAVE TUTORIAL (MATLAB): MATRIX - Solving Linear equations using Matrix • LESSON 2.3 OCTAVE TUTO...
7. Finding Roots if Linear three linear equations using Matrix- Octave • Finding Roots if Linea...
8. Transfer Function - Process Control Example 1 using Octave • Transfer Function - Pr...
9. Transfer Function - Process Control Example 2 using Octave • Transfer Function - Pr...
10. Transfer Function - Process Control Example 3 using Octave • Transfer Function - Pr...
11. Transfer Function -Process Control Example 4 using Octave. Solve Series, Parallel, Negative Feedback • Transfer Function -Pro...
12. Step By Step Guide. Transfer Function -Process Control E.g 5 using Octave. Series,Parallel,Feedback • Step By Step Guide. Tr...
13. [z,p,k] = tf2zp on Octave. Transfer Function - Process Control Example 6. Step by Step Guide • [z,p,k] = tf2zp on Oct...
14. Lesson 3 - 2D plot, Labels,colour, Subplot, Bar, histo , polar, semilog, loglog, 3D Mesh Surfaces • Lesson 3 - 2D plot, La...
15. Example: Control Statments, For Loop, While Loop, If , Else, ElseIf Statement. Lesson 4.1 • Example: Control Statm...
16. Approximation of Roots using Bisection, Newton and Secant Method. Lesson 4.2 • Approximation of Roots...
17. Example: Integration Octave Quadrature Method- Trapezoidal, Simpson,Clenshaw-Curtis Rule. Lesson 5.1 • Example: Integration O...
18. Plotting and Finding Roots using Octave Y = 2x^2 + 4x -4 • Plotting and Finding R...
19. Scientific Notation with 13 or 9 decimal places, Sprintf, Round, Floor and Fix. Using Octave Example • Video
20. Find the Size, minimum, Maximum of an Array using Octave. Creating a Row and Column vector, Linspace • Find the Size, minimum...
Coco Simulation:
1. How to Download and install Coco Simulator using Windows • How to Download and in...
2. Production of Dimethyl Ether (DME) from Methanol Using CoCo Simulation • Production of Dimethyl...
-------------------------------------------------------------------------------------------------------------------------------------
Email any example you'd like for me to solve something similar of
chemicalengineerwithkgabisang@gmail.com
Or comment your questions Thanks for watching next tricky problems / lessons that will broaden your knowledge are coming
----------------------------------------------------------------------------------------------------------------------------------------
11 сен 2024