Sunteți pe pagina 1din 4

Lab : 2 After covid_19

Electro mechanical systems

Name : Ameer said


Registration number : 18pwmct0634
Lab instructor : Eng.Shahbaz khan
Section : A
Department : Mechatronics Engineering
Date : 6/9/2020
 Objectives
 The first objective of this lab is to understand the basics of matlab
 The second is objective is to understand the basic commands in matlab
 The third objective is to know about the use of matlab
 To understand basic calculations in matlab
 Introduction to matlab
MATLAB is a powerful technical computing system for handling scientific and engineering
calculations[ CITATION DHA19 \l 1033 ]. The name MATLAB stands for Matrix Laboratory, because the
system was designed to make matrix computations particularly easy. A matrix is an array of numbers
organized in m rows and n columns. An example is the following m × n = 2 × 3 array: A = 135 246 Any
one of the elements in a matrix can be accessed by using the row and column indices that identify its
location. The elements in this example are accessed as follows: A(1, 1) = 1, A(1, 2) = 3, A(1, 3) = 5, A(2,
1) = 2, A(2, 2) = 4, A(2, 3) = 6. The first index identifies the row number counted from top to bottom;
the second index is the column number counted from left to right. This is the convention used in
MATLAB to locate information in a matrix. A computer is useful because it can do numerous
computations quickly, so operating on large numerical data sets listed in tables or matrices (or arrays)
of rows and columns is quite efficient[ CITATION DHA19 \l 1033 ]. One of the many things you will like
about MATLAB (and that distinguishes it from many other computer programming systems, such as C+
+ and Java) is that you can use it interactively. This means you type some commands at the special
MATLAB prompt and get results immediately. The problems solved in this way can be very simple, like
finding a square root, or very complicated, like finding the solution to a system of differential
equations. For many technical problems, you enter only one or two commands—MATLAB does most of
the work for you[ CITATION DHA19 \l 1033 ].
 Multiplication of two matrices in matlab
>> A=[3 5 6;2 4 6;5 3 2]; %3x3 matrix
>> B=[5 6 3;2 3 2;5 3 5]; %3x3 second matrix
>> C=[5 4 3;2 4 5;2 3 2]; %3x3 third matrix
>> A*C % multiplication of two matrixes

ans =

37 50 46
30 42 38
35 38 34
 Proving associative law of addition in matlab
>> %Associative law of addition A+(B+C)=B+(A+C)
>> A+(B+C) % LHS of associative law of addition

ans =
13 15 12
6 11 13
12 9 9

>> (A+B)+C % RHS of associative law of addition

ans =

13 15 12
6 11 13
12 9 9

>> % Hence proved LHS=RHS


 Proving associative law of multiplication in matlab
>> % Associative law of multiplication A*(B*C)=(A*B)*C
>> A*(B*C) % LHS of associative law of multiplication

ans =

475 571 518


412 492 442
357 437 410

>> (A*B)*C % RHS of associative law of multiplication

ans =

475 571 518


412 492 442
357 437 410

>> % Hence proved LHS=RHS

Bibliography

[1 B. D.HAhn, "Essential matlab for engineers and scientists," in Essential matlab for engineers and scientists,
] san diego USA, Mathworks, 2019, p. 406.

[2 "Google.com," google.com, [Online]. Available: https://www.google.com.pk/search?


] q=universal+testing+machine&sxsrf=ALeKk01TjeUHDWp__TaYWFfipCEU6D7MMQ:1583661306103&source
=lnms&tbm=isch&sa=X&ved=2ahUKEwiA4-
CMzoroAhUQ2BoKHQe3A3QQ_AUoAXoECA0QAw&biw=1366&bih=655#imgrc=jgS5mSjHq1C1CM.

[3 "Google.com," [Online]. Available: https://www.google.com.pk/search?


] q=brinell+hardness+testing+machine&tbm=isch&ved=2ahUKEwjQk_Sbz4roAhWX_IUKHRKeD-IQ2-
cCegQIABAA&oq=bri&gs_l=img.1.0.0i67l9j0.128799.131675..133629...1.0..4.302.2194.2-7j1......0....1..gws-
wiz-img.....10..35i39j35i362i39.eGG2.

[4 "google.com," [Online]. Available: https://www.google.com.pk/search?


] q=strain+gauge&tbm=isch&ved=2ahUKEwijgsPcz4roAhUL5hoKHdpUCVwQ2-
cCegQIABAA&oq=strain&gs_l=img.1.0.0i67l3j0l7.148949.152017..153850...2.0..0.217.1480.2-
7......0....1..gws-wiz-img.....10..35i362i39j35i39j0i131.Xud6TDH8U2E&ei=.

[5 "google.com," [Online]. Available: https://www.google.com.pk/search?


] q=spring+testing+machine&tbm=isch&ved=2ahUKEwjQk_Sbz4roAhWX_IUKHRKeD-IQ2-
cCegQIABAA&oq=spring+&gs_l=img.1.0.0i67l6j0j0i131j0j0i131.7552.14977..16744...5.0..0.256.2411.0j3j8.....
.0....1..gws-wiz-img.....10..35i362i39j35i39j.

[6 "google.com," [Online]. Available: https://www.google.com.pk/search?


] q=deformation+measurement+machine&tbm=isch&ved=2ahUKEwiox57o0IroAhVH0RoKHZOQBCQQ2-
cCegQIABAA&oq=deformation+measurement+machine&gs_l=img.12...108930.127037..135794...3.0..1.417.
5612.0j3j15j4j1......0....1..gws-wiz-img......

S-ar putea să vă placă și