You are on page 1of 41

FEDERAL UNIVERSITY OF TECHNOLOGY OWERRI

P.M.B 1526 OWERRI, IMO STATE

REPORT ON
STUDENTS’ INDUSTRIAL WORK EXPERIENCE SCHEME
(SIWES)
TRAINING PROGRAMME
(200 LEVEL)

DONE AT
EEE LECTURE HALL 1

BY
OBIDIEBUBE MICHAEL CHIMUANYA
MAT NO: 20201207213

SUBMITTED TO
THE DEPARTMENT OF MECHATRONICS ENGINEERING,
SCHOOL OF ELECTRICAL SYSTEM AND ENGINEERING
TECHNOLOGY

IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR


THE AWARD OF BACHELOR OF TECHNOLOGY (B.ENG)
DEGREE IN MECHATRONICS ENGINEERING

AUGUST, 2023
DEDICATION
This report is dedicated to almighty God Almighty the giver of life, who kept me
throughout the Internship period and for his continual providence.

[ii]
ACKNOWLEDGEMENT
I want to use this medium to acknowledge my parents for their support, love and
care throughout my stay in this great institution. I also want to acknowledge my
sisters for always being there for me.
Finally, to all my Departmental Lecturers who in one way or the other impacted
into my life.

[iii]
ABSTRACT
This report chronicles a comprehensive industrial training program centered
around MATLAB, a powerful computational tool vital in the field of Mechatronics
Engineering. Over two transformative weeks, our team engaged in an immersive
training experience, aimed at mastering MATLAB's capabilities and their real-
world applications.

Under the guidance of industry experts, we delved into MATLAB's programming


constructs, data analysis, and visualization capabilities, equipping ourselves with a
versatile skill set. This report emphasizes the pivotal role of continuous learning
and adaptation in engineering, showcasing MATLAB as a catalyst for enhanced
productivity, informed decision-making, and innovation.

Our journey unfolded through a blend of training modules and hands-on projects,
including the creation of a MATLAB-based CGPA Calculator. This report
encapsulates our learnings, projects, and recommendations, positioning us as
better-prepared engineers poised to contribute to the ever-evolving field of
Mechatronics Engineering.

[iv]
TABLE OF CONTENTS
DEDICATION...............................................................................................................................................ii
ACKNOWLEDGEMENT............................................................................................................................iii
ABSTRACT..................................................................................................................................................iv
TABLE OF CONTENTS...............................................................................................................................v

CHAPTER ONE..........................................................................................................................................7
INTRODUCTION.........................................................................................................................................7
1.1 OVERVIEW OF SIWES ....................................................................................................................7
1.2 HISTORICAL DEVELOPMENT OF SIWES OPERATIONS..........................................................8
1.3 OBJECTIVES OF SIWES.................................................................................................................11

CHAPTER TWO.......................................................................................................................................12
HISTORY AND COMPANY PROFILE....................................................................................................12
2.1 ABOUT THE COMPANY...............................................................................................................12
2.2 VISION/PURPOSE OF THE ESTABLISHMENT..........................................................................12

CHAPTER THREE...................................................................................................................................14
LED AND LCD TELEVISIONS.................................................................................................................14
3.1 LCD (LIQUID CRYSTAL DISPLAY TELEVISION).....................................................................14
3.2 LED TELEVISION..........................................................................................................................14
3.3 DIFFERENCE BETWEEN LED AND LCD
TV………………………………………………………………………................................................14
3.4 BASIC COMPONENTS IN A LCD/LED TELEVISION SET AND THEIR USES
………………………...15
3.4.1 RESISTORS
…………………………………………………………………………………………………………
…15 3.4.2 CAPACITOR
…………………………………………………………………………………………………………
..16 3.4.3
TRANSISTORS………………………………………………………………………………………
………………..18

CHAPTER FOUR......................................................................................................................................21

[v]
BOARDS AND EQUIPMENTS.................................................................................................................21
4.1
BOARDS……………………………………………………………………………………………....
………………………... 21
4.1.1 POWER BOARD
…………………………………………………………………………………………………….. 21
4.1.2 MOTHER BOARD
……………………………………………………………………………………………..…….21
4.2 WORKING OF NEGATIVE SCREEN ............................................................................................24
4.3 BASIC EQUIPMENTS USED IN TV REPAIR
……………………………………………………………………… 24

CHAPTER FIVE.......................................................................................................................................27
VARIOUS TROUBLESHOOTING PROCESSES,FAULTS AND PROBABLE SOLUTIONS..............27
5.1 TROUBLESHOOTING PROCESSES………………………………………………………....
………………………... 27
5.2.1 POWER ASSOCIATED
PROBLEMS……………………………………………………………………….. 27
5.2.2 HOW TO READ FOUR LEG DIODE…….
………………………………………………………………..…….27
5.3 OTHER TROUBLESHOOTING
PROCESSES………………………………………………………………………..28
5.3.2 HOW TO IDENTIFY DAMAGED LED
BULBS………………………………………………………………29

CHAPTER SIX..........................................................................................................................................30
REPAIRS OF BOARDS AND SCREEN....................................................................................................30
6.1 REPAIR OF POWER BOARDS………………………………………………………………....
………………………... 30
6.2.1 CONVERSION OF POWER BOARDS ...
……………………………………………………………………….. 30
6.3 REPAIR OF INVERTER BOARDS…………………………………………………………....
……………………….....32
6.3.3 CONVERSION OF INVERTER
BOARDS………………………………………………………………..…….33

[vi]
6.4 SCREEN
REPAIR………………………………………………………………………………………………………
……..36
6.5 WORKING ON BURNT
SCREEN………………………………………………………………………………………..37

CHAPTER SEVEN
CONCLUSION, PROBLEMS ENCOUNTERED AND RECOMMENDATIONS
5.1 CONCLUSION
5.2 PROBLEMS ENCOUNTERED
5.3 RECOMMENDATION
……………………………………………………………………………………………………… 39

REFERENCE
………………………………………………………………………………………………………………
…………….41

[vii]
CHAPTER ONE
INTRODUCTION
1.1 OVERVIEW OF SIWES
The Students Industrial Work Experience Scheme (SIWES) is a Skills Training
Programme designed to expose and prepare Students of Universities, Polytechnics,
Colleges of Technology, Colleges of Agriculture and Colleges of Education for the
Industrial Work situation they are likely to meet after graduation. The Scheme also
affords Students the opportunity of familiarizing and exposing themselves to the needed
experiences in handling equipment and machinery that are usually not available in their
Institutions.
Before the establishment of the Scheme, there was a growing concern among our
industrialists that graduates of our Institutions of higher learning lacked adequate
practical background studies preparatory for employment in Industries. Thus, Employers
were of the opinion that the theoretical education in Higher Institutions was not
responsive to the needs of the Employers’ of Labour.
It is against this background that the Industrial Training Fund (ITF) initiated, designed
and introduced SIWES Scheme in 1973 to acquaint Students with the skills of handling
Employers’ equipment and machinery.
The Industrial Training Fund (ITF) solely funded the Scheme during the formative
years. However, due to financial constraints, the Fund withdrew from the Scheme in
1978. The Federal Government, noting the significance of the skills training, handed the
management of the Scheme to both the National Universities Commission (NUC) and
the National Board for Technical Education (NBTE) in 1979. The management and
implementation of the Federal Government in November, 1984 and the administration
was effectively taken over, by the Industrial Training Fund in July 1985, with the
funding solely borne by the Federal Government.
During my Industrial Training which was undertaken between November 2019-
December 2019, most of these SIWES objectives were achieved.

8
1.2 HISTORICAL DEVELOPMENT OF SIWES OPERATIONS
The vision of Industrial Training Fund, when it initiated the Students Industrial Work
Experience Scheme (SIWES) in 1973, was the provision of an avenue for students to
acquire practical industrial exposure in their respective disciplines during their course of
studies. Such exposure, it was envisaged, would prepare students to fit, more readily,
into an industrial work environment after their academic career. The scheme was also
designed to offer lectures the opportunity to evaluate the relevance of training to the
needs of industry.

The scheme commenced in 1974 with eleven (11) institutions. By 1978, when the
number of institutions had grown from eleven to thirty-two (32), the ITF was forced to
reduce the number of approved programs to Engineering and Technology disciplines in
universities, polytechnics and colleges of technology. In 1979, the Federal Ministry of
Education made it compulsory for all students of polytechnics and colleges of
technology to undergo one-year Industrial Attachment. This new arrangement created a
financial burden which was too high to be shouldered by the ITF. In addition, the fund
did not have the capacity to monitor and supervise all students on Industrial Attachment
hence, its decision to withdraw its support for polytechnics and colleges of technology.

Furthermore, despite limiting the program to universities, the financial implication in


respect of the number of students was still too high for the ITF to shoulder.
Consequently, all participating universities were duly notified that the ITF would be
withdrawing from financing the scheme as from January, 1980.

As a result of ITFs withdrawal, Federal Government took over the funding of the
scheme through the National Universities Commission (NUC) and the National Board
for Technical Education (NBTE). These two commissions managed the scheme for five
(5) years (1979-1984).

9
When the NBTE assumed administration of the scheme for students of polytechnics and
colleges of technology under the one-tier system of Technical Education, the
nomenclature was changed to “Compulsory Supervised Industrial Training Attachment”
(COSITA). During this period, the scheme was expanded to include fifty (50)
disciplines, many of which were non technical. As a result of this, the operation of the
scheme became more complex and cumbersome. Consequently, the Federal Government
handed over the administration of the scheme to the ITF in December, 1984.

In 1974, when the scheme started, a total of 784 students participated, while in 1978,
4713 students participated. Between 1979 and 1984 when the scheme was handled by
NUC and NBTE, reliable figures on student’s participation were not compiled due to
operational problems. When the ITF took over the scheme again in 1985, a total of
16,912 students participated. As the number of institutions kept on increasing, the
number of students participating in the scheme also continued to rise. For example,
between 1985 and 1995, the number of institutions rose to 141 with a total of 57,433
students. Similarly, as institutions of higher learning continued to introduce new courses,
the level of student’s enrolment continued to increase alongside persistent demand for
participation in the scheme.

One of the strategies designed to facilitate smooth operations of the scheme is the
payment of supervisory allowances to higher institutions and monthly allowances to the
benefiting students. Between 1974 and 1978, ITF financed the scheme, while from 1979
to 1998 the Federal Government took over the financing through the NUC and NBTE.
During this period, the initial allowance made to students was N30.00 per student per
month. This was increased to N50.00 and then N90.00 in 1976. As from 1981 there was
a relative increase in both supervisory and students allowances to N25.00 per student per
month and N250.00 per student per month respectively. This allowance regime prevailed
until it was reviewed to the present rate of N2,500 per student per month. The students

10
Industrial Work Experience Scheme serves as an accepted skills training program. The
program is part of the Minimum Academic Standards in the various degree programs
within Nigerian Universities. The SIWES program helps to harmonize the extensive
theoretical background of the industry. By this scheme, students are exposed to
equipment and infrastructure, which are not affordable by, or unavailable in the tertiary
institutions.

During the industrial training, students are exposed to machines equipment, professional
methods to work, industrial safety of the work equipment as well as the workers in the
industries and other relevant workplaces such as research institutions, etc. Industrial
work is not necessarily limited to indoor work. Field work could also be involved during
the training. In this case, the student is expected to make the best use of the training
period to adapt to work in all the relevant domains. The generally approved duration for
student’s industrial work experience scheme is twenty-four (24) weeks. This means that
a student needs to be on the program for six (6) months in order to get the best value
from the training.

1.3 OBJECTIVES OF SIWES


1) To provide an avenue for students in Nigerian universities to acquire industrial
skills and experience in their course of study.
2) To prepare students for the work situation they are likely to meet after
graduation.
3) To expose students to work methods and techniques in handling equipment
and machinery that may not be available in the universities and other
institutions of higher learning.
4) To produce students with an opportunity to apply their theoretical knowledge
in real work situations, thereby bridging the gap between university work and
actual practice.

11
5) To make the transition from university to the place of work easier, and thus,
enhance students contacts for later job placement.
6) To enlist and strengthen employer’s involvement in the entire education
process of preparing university and other tertiary graduates for employment in
industry.

12
CHAPTER TWO
HISTORY AND COMPANY PROFILE
2.1 ABOUT THE COMPANY
Our SIWES 200 training was conducted under the guidance of CSAAE (Center for
Social Awareness, Advocacy, and Ethics). CSAAE structured our training program to
enhance our skills and knowledge, providing us with valuable insights and mentorship.
The Center for Social Awareness, Advocacy, and Ethics (CSAAE) is a non-profit
organization based in Nigeria with a mission to empower young Africans with the skills,
knowledge, and ethical values necessary to become responsible and ethical leaders in
their communities.
2.1.1 History: The CSAAE was founded with a vision to empower young Africans with
the skills, knowledge, and values necessary to become ethical leaders and change-
makers in their communities. It was established by Rev. Fr. Dr. Godswill Agbagwa, a
passionate advocate for youth development and ethical leadership.
2.2 VISION/PURPOSE OF THE ESTABLISHMENT
2.2.1 Vision: The vision of CSAAE's DSEP is to empower young Africans with the
digital skills and knowledge needed to thrive in the digital age and to become leaders in
their communities. It envisions a future where every young African has access to quality
digital education and can harness the power of technology for personal and societal
development.
2.2.2 Purpose of establishment:
Bridge the Digital Divide: DSEP was established to bridge the digital divide that exists
in many African communities. It aims to ensure that young Africans, regardless of their
background or location, have access to digital skills and can participate in the digital
economy.

Enhance Employability: One of the primary purposes of DSEP is to enhance the


employability of young Africans. In today's world, digital skills are in high demand
across various industries. DSEP equips participants with these skills, making them more
attractive to potential employers.

13
Foster Innovation: DSEP encourages innovation and creativity among young Africans.
By providing training in areas like programming, web development, and digital
marketing, it empowers participants to create digital solutions to local and global
challenges.

Promote Entrepreneurship: DSEP not only prepares young Africans for employment
but also encourages entrepreneurship. It equips participants with the skills needed to
start their own digital businesses, contributing to economic growth and job creation.

Empower Communities: The program has a broader societal purpose, aiming to


empower entire communities. When young people in a community have digital skills,
they can use their knowledge to drive positive change, address local issues, and improve
living conditions.

Instill Ethical Values: While imparting digital skills, DSEP also emphasizes ethical
values. It seeks to create a generation of responsible and ethical digital leaders who use
their skills for the betterment of society.

Support Sustainable Development: DSEP aligns with the United Nations' Sustainable
Development Goals (SDGs), particularly those related to quality education, decent work
and economic growth, and industry, innovation, and infrastructure.

In essence, the purpose of establishing CSAAE's Digital Skills Empowerment Program


(DSEP) is to empower young Africans with the digital skills and ethical values needed to
succeed in the digital age, drive positive change, and contribute to the sustainable
development of their communities and the continent as a whole.

14
CHAPTER 3

Introduction to MATLAB

MATLAB is a high-level language and environment for numerical computation and visualization. It
was developed by Cleve Moler of the University of New Mexico in 1984. MATLAB is a matrix-based
language, which means that it works with data that is organized in matrices. This makes it ideal for
solving problems that involve large amounts of data. MATLAB also has a wide range of built-in
functions for performing mathematical operations, plotting data, and creating simulations.

MATLAB logo

MATLAB Uses

MATLAB can be used for a variety of tasks, including:

Numerical computing: MATLAB is a powerful tool for performing numerical computations. It can be
used to solve linear and nonlinear equations, perform statistical analysis, and optimize functions.

15
MATLAB numerical computing

Data analysis: MATLAB has a wide range of tools for analyzing data. It can be used to plot data, fit
curves to data, and perform statistical analysis.

MATLAB data analysis

Visualization: MATLAB is a powerful tool for visualizing data. It can be used to create 2D and 3D plots,
animations, and interactive visualizations.
Simulation: MATLAB can be used to create simulations of physical systems. It can be used to simulate
the behavior of machines, the flow of fluids, and the spread of diseases.
Machine learning: MATLAB is a popular tool for machine learning. It can be used to train and deploy
machine learning models.
Image processing: MATLAB can be used to process images, such as removing noise, enhancing

16
MATLAB visualization contrast, and detecting edges.
MATLAB simulation

Signal processing: MATLAB can be used to process signals, such as filtering, denoising, and
extracting features.

Control systems: MATLAB can be used to design and simulate control systems.

Advantages of MATLAB

17
Some of the advantages of MATLAB include:

 It is a powerful and versatile tool for numerical computation, data analysis, and visualization.
 It has a wide range of built-in functions for performing mathematical operations and plotting
data.

 ItIt is easy to learn and use, even for beginners.


 It has a large and active community of users and developers.

 There are many resources available for learning MATLAB, including books, tutorials, and
online courses.
 It is platform-independent, meaning that it can be used on Windows, Mac, and Linux
computers.
 It is constantly being updated with new features and functionality.

Disadvantages of MATLAB

Some of the disadvantages of MATLAB include:

 It is a commercial software, which means that it requires a license to use.

18
 It can be expensive, especially for students and hobbyists.
 It is not as portable as some other programming languages, such as Python.
 It can be slow for some tasks, such as large-scale data analysis.

 MATLAB Downloading and Installation


 To download MATLAB, you can go to the MathWorks website. There are different
versions of MATLAB available, depending on your needs. Once you have downloaded
the MATLAB installer, you can follow the instructions to install it on your computer.
 Downloading MATLAB
 To download MATLAB, you can go to the MathWorks website:
https://www.mathworks.com/products/matlab.html and click on the "Downloads" tab.
Then, select the version of MATLAB that you want to download and click on the
"Download" button.
 MATLAB Installation
 Once you have downloaded the MATLAB installer, you can follow the instructions to
install it on your computer. The installation process is relatively straightforward and
should take a few minutes to complete.

Matlab command

MATLAB commands are the instructions that you give to MATLAB to perform a task.
MATLAB commands are case-insensitive, so you can write them in upper or lower case.

There are many MATLAB commands, but some of the most basic and commonly used
commands include:

 clc: Clears the command window.

clear: Clears all variables from the workspace.

19
disp: Displays the value of a variable or expression.

plot: Plots a graph of a function or data set.


while: Executes a block of code repeatedly until a condition is met.

Resolution of matrices in MATLAB

The resolution of a matrix in MATLAB is the number of rows and columns in the matrix. For
example, a matrix with 10 rows and 5 columns has a resolution of 10x5.

20
To get the resolution of a matrix in MATLAB, you can use the size() function. The size()
function takes a matrix as input and returns a vector with two elements, where the first
element is the number of rows in the matrix and the second element is the number of columns
in the matrix.
For example, the following code will print the resolution of the matrix A:
A = [1 2 3; 4 5 6; 7 8 9]
size(A)

Output:

3 3
Indexing into and modifying arrays in MATLAB

Indexing into an array in MATLAB is the process of accessing a specific element in the array.
To index into an array, you use square brackets and the row and column numbers of the
element that you want to access.

For example, to access the element in the second row and third column of the array A, you
would use the following code:
A(2, 3)

Output:

6
To modify an element in an array, you simply assign a new value to the element using the
assignment operator (=). For example, to modify the element in the second row and third
column of the array A to the value 10, you would use the following code:
A(2, 3) = 10
You can also use indexing to access and modify subarrays of an array. To access a subarray,
you use square brackets and a range of row and column numbers. For example, to access
the subarray of the array A that contains the elements in the second row and the second to
fourth columns, you would use the following code:
A(2, 2:4)

Output:

[6 7 8]

21
To modify a subarray, you simply assign a new array to the subarray using the assignment
operator (=). For example, to modify the subarray of the array A that contains the elements in
the second row and the second to fourth columns to the array B, you would use the following
code:
B = [10 20 30]
A(2, 2:4) = B
Examples

The following examples show how to index into and modify arrays in MATLAB:

% Create an array A = [1 2 3; 4 5 6; 7 8 9]

% Access the element in the second row and third column A(2, 3)

% Modify the element in the second row and third column to the value 10 A(2, 3) = 10

 % Access the subarray that contains the elements in the second row and the second to
fourth columns A(2, 2:4)

% Modify the subarray that contains the elements in the second row and the second to fourth
columns to the array B B = [10 20 30] A(2, 2:4) = B

Conclusion

Indexing into and modifying arrays is a fundamental skill in MATLAB. By understanding how
to index into and modify arrays, you can perform a wide variety of tasks, such as data
analysis, image processing, and signal processing

. Plotting Data in MATLAB

During my SIWES training, I had the opportunity to work on various projects that involved
collecting, analyzing, and visualizing data. MATLAB, with its rich set of plotting tools, proved

22
to be an invaluable resource for presenting data effectively. In this section, I will discuss how
MATLAB was utilized to plot and visualize data in the context of Mechatronics Engineering.

4.2.1 Basic Plotting in MATLAB

MATLAB offers a wide range of functions for creating different types of plots, including line
plots, scatter plots, bar plots, histograms, and more. Here are some key aspects of basic
plotting in MATLAB:

Line Plots: The plot() function is commonly used to create line plots. It allows for the
visualization of data trends over one or two-dimensional spaces.

Scatter Plots: Scatter plots are generated using the scatter() function. They are useful for
displaying individual data points and identifying patterns or outliers.

Bar Plots: MATLAB's bar() function is employed to create bar plots, which are useful for
comparing data across categories or groups.

Histograms: The histogram() function is used to create histograms, providing insights into
data distribution and frequency.

4.2.2 Customizing Plots

23
MATLAB provides extensive options for customizing plots to enhance their clarity and visual
appeal. Some common customization options include:

Labels and Titles: Adding labels to axes, titles to plots, and legends to distinguish multiple
data series.

Line Styles and Colors: Changing line styles, colors, and markers to differentiate data series.

Axis Limits: Adjusting axis limits to focus on specific data ranges.

Grids and Annotations: Adding grids to plots and annotations to highlight specific data points
or features.

4.2.3 Advanced Plotting Techniques

In addition to basic plotting, MATLAB supports advanced techniques for data visualization:

3D Plots: MATLAB can create 3D plots to visualize data in three-dimensional space, which is
useful for applications like surface plotting.

24
Contour Plots: Contour plots, generated using the contour() function, are useful for visualizing
data with continuous variations, such as temperature maps.

Heatmaps: MATLAB's heatmap functions allow for the creation of heatmaps to represent data
with color intensity.

Animated Plots: MATLAB can create animated plots, making it valuable for visualizing
dynamic or time-dependent data.

4.2.4 Exporting and Sharing Plots

MATLAB makes it straightforward to export plots in various formats, including image files
(e.g., PNG, JPEG), vector graphics (e.g., SVG, PDF), and interactive figures (e.g., HTML).
This flexibility is beneficial for incorporating MATLAB-generated plots into reports,
presentations, and publications.

4.2 Plotting Data in MATLAB

During my SIWES training, I had the opportunity to work on various projects that involved
collecting, analyzing, and visualizing data. MATLAB, with its rich set of plotting tools, proved
to be an invaluable resource for presenting data effectively. In this section, I will discuss how
MATLAB was utilized to plot and visualize data in the context of Mechatronics Engineering.

25
4.2.1 Basic Plotting in MATLAB

MATLAB offers a wide range of functions for creating different types of plots, including line
plots, scatter plots, bar plots, histograms, and more. Here are some key aspects of basic
plotting in MATLAB:

Line Plots: The plot() function is commonly used to create line plots. It allows for the
visualization of data trends over one or two-dimensional spaces.

Scatter Plots: Scatter plots are generated using the scatter() function. They are useful for
displaying individual data points and identifying patterns or outliers.

Bar Plots: MATLAB's bar() function is employed to create bar plots, which are useful for
comparing data across categories or groups.

Histograms: The histogram() function is used to create histograms, providing insights into
data distribution and frequency.

4.2.2 Customizing Plots

26
MATLAB provides extensive options for customizing plots to enhance their clarity and visual
appeal. Some common customization options include:

Labels and Titles: Adding labels to axes, titles to plots, and legends to distinguish multiple
data series.

Line Styles and Colors: Changing line styles, colors, and markers to differentiate data series.

Axis Limits: Adjusting axis limits to focus on specific data ranges.

Grids and Annotations: Adding grids to plots and annotations to highlight specific data points
or features.

4.2.3 Advanced Plotting Techniques

In addition to basic plotting, MATLAB supports advanced techniques for data visualization:

3D Plots: MATLAB can create 3D plots to visualize data in three-dimensional space, which is
useful for applications like surface plotting.

27
Contour Plots: Contour plots, generated using the contour() function, are useful for visualizing
data with continuous variations, such as temperature maps.

Heatmaps: MATLAB's heatmap functions allow for the creation of heatmaps to represent data
with color intensity.

Animated Plots: MATLAB can create animated plots, making it valuable for visualizing
dynamic or time-dependent data.

4.2.4 Exporting and Sharing Plots

MATLAB makes it straightforward to export plots in various formats, including image files
(e.g., PNG, JPEG), vector graphics (e.g., SVG, PDF), and interactive figures (e.g., HTML).
This flexibility is beneficial for incorporating MATLAB-generated plots into reports,
presentations, and publications.

PLOTTING DATA

Probably the most common method for creating a plot is by issuing plot(x, y) statement
where function y is plotted against x.
Type in the following statement at the MATLAB prompt:

x=[-pi:.1:pi]; y=sin(x); plot(x,y);

28
After we executed the statement above, a plot named Figure1 is generated:

Graph of sin(x)

Having variables assigned in the Workspace, x and y=sin(x) in our case, we can also
select x and y, and right click on the selected variables. This opens a menu from which
we choose plot(x,y). See the figure below.

29
Annotating Plots
Graphs without labels are incomplete and labeling elements such as plot title, labels for
x and y axes, and legend should be included. Using up arrow, recall the statement above
and add the annotation commands as shown below.
Run the file and compare your result with the first one.

30
Graph of sin(x) with Labels.

Superimposed Plots

If you want to merge data from two graphs, rather than create a new graph from
scratch, you can superimpose the two using a simple trick

31
Graph of sin(x) and cos(x) in the same plot with labels and legend.

IMPORTING DATA

MATLAB provides a simple way of importing data into a script using the importdata()
function. This function takes various inputs and can be used in following forms.
Method 1:
This simply takes the data file and creates a suitable struct for the same within the
script.
Example 1:

% MATLAB Code for import data


a = importdata('logo.jpg');

% Verifying the data


image(a)

Output:

This would first load the logo.jpg file as a struct and then, the second statement would display that data as an
image to verify the data.

32
Method 2:
Now let us import a file with delimiters and headers. Our data file has the following
dummy data with headers and delimiter ‘ ‘.
col1 col2 col3
10.1 12.3 13.7
14.2 13.6 11.9
0.13 1.13 13.1
Example 2:

33
% Importing this into MATLAB script
% delimiter
delimiterIn = ' ';

% of header lines
headerlinesIn = 1;

% Importing the data


a = importdata('data.txt',delimiterIn, headerlinesIn);

% Display the data with headers


disp(a.colheaders)
disp(a.data(:,:))

34
Output:

Importing data into MATLAB can be done in a number of ways. The most common way
to import data is to use the importdata() function. The importdata() function can
import data from a variety of file formats, including text files, CSV files, and Excel files.
To import data using the importdata() function, you need to specify the file name and
the file format. You can also specify the delimiter that is used to separate the data in the
file.
For example, the following code will import the data from the file data.csv using the
importdata() function:
data = importdata('data.csv');
The data variable will now contain a matrix of the data that was imported from the file.
You can also use the importtool() function to import data into MATLAB. The
importtool() function provides a graphical user interface for importing data from a
variety of file formats.

35
To import data using the importtool() function, you need to select the file that you
want to import and then click the "Import" button. The importtool() function will then
display a window where you can specify the delimiter that is used to separate the data
in the file.
Once you have specified the delimiter, you can click the "OK" button to import the data.
The importtool() function will then create a matrix of the imported data and assign it
to the variable data.
In addition to the importdata() and importtool() functions, there are a number of
other tools that can be used to import data into MATLAB. For example, you can use the
xlsread() function to import data from Excel files and the websave() function to import
data from web pages.
Here are some additional tips for importing data into MATLAB:
 Make sure that the data file is in a format that MATLAB can read.

 If the data file is in a text file format, make sure that the data is separated using a
delimiter that MATLAB can recognize, such as a comma or a tab.

 If the data file is in an Excel file format, make sure that the data is in a worksheet.

 If the data file is on the web, make sure that the URL is correct.

Once you have imported the data into MATLAB, you can use the MATLAB functions
and tools to analyze and visualize the data.

2.2.1 Project: Building a CGPA Calculator with MATLAB

One of the highlights of my SIWES training was the opportunity to undertake a hands-
on project that showcased the practical application of MATLAB in solving real-world
problems. In this section, I will describe the project I worked on, which involved
designing and implementing a CGPA (Cumulative Grade Point Average) calculator
using MATLAB.

Project Overview:

36
The goal of this project was to create a user-friendly MATLAB program capable of
calculating the CGPA of a student based on their course grades and credit hours.
CGPA is a critical metric in academic assessment, and having a tool to compute it
efficiently is highly beneficial for both students and academic institutions.

Key Features of the CGPA Calculator:

Our CGPA calculator program had several essential features:

Input of Course Grades and Credit Hours: Users could input their course grades and the
respective credit hours for each course.

Grade Point Calculation: The program calculated the Grade Points (GP) for each course
based on the entered grade. In many educational systems, grades are associated with
specific GP values (e.g., A=4.0, B=3.0, etc.).

CGPA Calculation: The CGPA was computed by summing the product of each course's
GP and credit hours, and then dividing by the total credit hours.

User-Friendly Interface: We designed a user-friendly graphical interface that allowed


students to input their data easily.

37
Implementation in MATLAB:

The project involved using MATLAB's programming capabilities to create a functional


CGPA calculator. Here is a high-level overview of the implementation process:

User Input: MATLAB's input dialog boxes were utilized to collect user input for course
grades and credit hours.

Grade-to-GP Mapping: We created a mapping between grades and GP values to


calculate the GP for each course.

CGPA Calculation: MATLAB performed the necessary calculations to determine the


CGPA based on the provided data.

Result Display: The calculated CGPA was displayed to the user, providing them with an
accurate representation of their academic performance.

Matlab
% CGPA calculator script using Matlab

% Ask the user to input the number of credit hours for each course
num_credits = input('Enter the number of credit hours for each course: ');

38
% Create a vector to store the credit hours
credit_hours = num_credits(:);

% Ask the user to input the grade for each course


grades = input('Enter the grade for each course (A, B, C, D, F): ');

% Create a vector to store the grades


grade_points = zeros(length(grades), 1);

% Convert the grades to grade points


for i = 1:length(grades)
if grades(i) == 'A'
grade_points(i) = 4;
elseif grades(i) == 'B'
grade_points(i) = 3;
elseif grades(i) == 'C'
grade_points(i) = 2;
elseif grades(i) == 'D'
grade_points(i) = 1;
else
grade_points(i) = 0;
end
end

% Calculate the CGPA


cgpa = sum(grade_points .* credit_hours) / sum(credit_hours);

% Display the CGPA


disp('Your CGPA is:');
disp(cgpa);

Benefits and Impact:

The CGPA calculator project served as a practical demonstration of how MATLAB can
be employed to develop tools that simplify complex calculations and improve efficiency.
Students can use this tool to monitor their academic progress and make informed

39
decisions about their studies. Moreover, academic institutions can utilize similar tools for
administrative purposes and to support students' academic success.

CONCLUSION
SUMMARY OF THINGS LEARNT AND PROJECTS EXECUTED
During my basic industrial training on MATLAB, I underwent a comprehensive
learning journey that covered skills and concepts. I began with the basics,
mastering fundamental operations such as variable creation, arithmetic
calculations, and result display. This strong foundation allowed me to progress
into more advanced areas of MATLAB's capabilities.

One of the pivotal aspects of the training was data manipulation and visualization.
I gained proficiency in creating various types of plots and charts, including line
plots, scatter plots, bar graphs, and advanced visualizations like 3D plots and
contour maps. The ability to customize these visualizations by adding labels, titles,
and legends greatly enhanced my data presentation skills.

Furthermore, I delved into the world of MATLAB functions, mastering the art of
creating custom functions with defined input and output arguments. I also
explored anonymous functions and function handles, which proved invaluable for
solving complex problems efficiently. This proficiency in function creation
empowered me to modularize and streamline my code, making it more readable
and maintainable.

As MATLAB is not just a software but a programming language, I learned essential


programming concepts such as loops (for and while), conditional statements (if,
else), and logical operators. These programming skills were instrumental in
developing versatile and robust scripts for various applications.

40
MATLAB's prowess in matrix operations and linear algebra was another highlight
of my training. These skills proved crucial in solving complex mathematical
problems and performing simulations in various fields, including engineering and
finance..

If my industrial training could have lasted a bit longer, I would have received
training in Simulink, a powerful graphical environment for modeling and
simulating dynamic systems. Simulink enabled me to simulate and analyze
complex systems, such as control systems and physical processes, using a visual
block-diagram approach.

MATLAB's capabilities extend beyond code execution; I also learned how to


generate professional reports and documents that combine code, visualizations,
and explanations. This skill was particularly useful for communicating my findings
and analyses effectively to colleagues and stakeholders.

Collaboration skills were honed through team projects, where I shared code and
data with colleagues. This collaborative experience enhanced my ability to work as
part of a team and leverage collective expertise.

In summary, my industrial training on MATLAB was a rich and multifaceted


experience. It equipped me with a versatile skill set, ranging from basic operations
to advanced mathematical concepts, data analysis, and simulations. These skills
are invaluable in addressing diverse challenges in fields such as engineering,
finance, research, and more, making MATLAB a fundamental tool in my
professional toolkit.

41

You might also like