You are on page 1of 11

Paper ID #33027

Introduction to MATLAB Programming in Fundamentals of Engineering Course


Dr. Djedjiga Belfadel, Fairfield University
Djedjiga Belfadel is an Associate Professor in the Electrical and Biomedical Engineering department
at Fairfield University. She obtained her Ph.D. degree from the University of Connecticut in 2015, in
electrical engineering. Her interests include embedded systems, target tracking, data association, sensor
fusion, machine vision, engineering service, and education.
Dr. Michael Zabinski, Fairfield University
Professor, Mechanical Engineering,Fairfield University, Fairfield, CT

Dr. Isaac Macwan, Fairfield University


Working in the field of Bioelectronics on molecular dynamics studies at the interface of biological macro-
molecules and nanoparticles and bacterial assisted nanofabrication strategies utilizing carbon based nano-
materials.

American
c Society for Engineering Education, 2021
Introduction to MATLAB Programming in a Fundamentals of Engineering Course
Djedjiga Belfadel, Michael Zabinski and Isaac Macwan
Fairfield University

This Evidence-based Practice Paper outlines the benefits of introducing MATLAB to incoming
freshmen. It is known that an engineering approach to problem solving should be taught with an
emphasis on teamwork, oral and written communication, creativity and ingenuity, which can be
accomplished by using coding and computer-aided design tools from early on in the curriculum.
The instructional approach taken in this three-credit course is the one in which students are active
participants in the learning process. Students typically do not have an opportunity to learn the
fundamentals of MATLAB until later in the curriculum, yet coding skills are very useful,
especially when introduced early on. MATLAB includes the requisite programming constructs,
has an easy to understand Graphical User Interface (GUI), and requires no prior programming
experience. It is therefore an ideal programming language to introduce in a first-year Fundamentals
of Engineering course. Students majoring in electrical, biomedical, and mechanical engineering,
and students who have yet to declare a major take this required course. The MATLAB portion of
the course consists of three 75-minute sessions that are presented in a workshop format and three
major assignments. The course provides core engineering knowledge and is taught in an interactive
format. It enriches the curriculum by teaching MATLAB programming in conjunction with a
variety of engineering problems in a relatively short time period. This paper presents data that is
related to homework assignments and student surveys and describes the methodology by which
data was collected. The approach taken is to develop student awareness of modern technology and
its use in engineering. This approach ties with ABET student outcome (1) and is based on recalling
facts and basic concepts according to Blooms taxonomy. The data shows that nearly 80% of the
incoming freshmen did comprehend the MATLAB basics and met the expectations of performing
well.
MATLAB programming was first introduced two years ago in the Fundamentals of Engineering
course. We report on this 2-year exercise and include student feedback from the second year.
Introduction
A computer programming course is required in most engineering curricula. Typically, such a
course is taught in the freshman or sophomore year and use either Fortran, C or JAVA as its
programming language. These programming languages are difficult to use when solving
engineering problems. Students therefore often do not reinforce their programming skills and lose
a potentially valuable tool. Furthermore, incoming first-year students lack math and engineering
problem solving skills [1]. This presents a challenge in teaching programming. It is therefore
important that the programming projects consist of problems that the students can relate to and
identify with. Also, the required math and engineering principles need to be presented in an
elementary and clear way. This requires starting out with elementary problems and subsequently
increasing their complexity. MATLAB has enough programming constructs to introduce
programming in an introductory course and also features a host of advanced application-specific
functions. It also includes graphical user interfaces, debugging tools, and symbolic mathematics.
Additional benefits of using MATLAB as first programming language include easy plotting,
advanced visualization, and powerful matrix mathematics that result in simpler programs and in
the development of advanced mathematics skills.

Students typically do not learn MATLAB until they take higher-level engineering courses [2].
Students then find themselves short on the basic skills they need to adapt to the course material.
We used the Fundamentals of Engineering course to teach students the basic knowledge of using
MATLAB. In this course multiple active learning projects and hands-on activities are
incorporated to provide an active learning environment to incoming first year students. This
course is required for first-semester engineering students at Fairfield University. A key factor is
the heterogeneous nature of the students taking the course, namely, electrical, biomedical,
mechanical and undeclared engineering students [3].

A major challenge in teaching MATLAB in this course is the fact that the first-year students
have not had much math or engineering prior to taking the course. It is therefore essential that the
problems are carefully selected and presented in a step by step manner that the students can
clearly understand [4]. This requires starting with elementary problems and then increasing the
complexity of the problems. It is difficult to cover all important MATLAB topics in three 75
minutes lectures and in three homework assignments. Students are therefore encouraged to earn
extra credit by completing MATLAB’s online training platform – Onramp. It is a free, self-
paced, and hands-on MATLAB training course that takes approximately two hours to complete.
Onramp includes eleven main topics and a final project in which students analyze the light
recorded from a star [5]. In the process students learn an important lesson about the transition
from conception to implementation.

The purpose of this paper is to provide information that will help optimize the curriculum in a
first-year engineering course and provide examples that are effective in introducing MATLAB to
first year students. This paper accomplishes this by studying some methods used by other
colleges and universities, along with a discussion of the techniques used by the authors that have
been effective in teaching MATLAB. We also present results of the survey administered at the
completion of the MATLAB.

Course Overview

The Fundamentals of Engineering course is team-taught to allow for continuous training of new
faculty, as well as to incorporate regular faculty feedback into the ongoing process of
improvement. We continuously measure the effectiveness of the course including its annual
improvements. The four sections of the course were recently taught by four faculty with the aid
of four Teaching Assistants (TA) who previously took the course [6].
First-year engineering courses are subject to a variety of factors in defining their purpose. The
goal of each course has been carefully selected a priori and is linked to ABET accreditation
course outcomes. The goals of the course are: (I) Create a passion for engineering. (II) Develop
an engineering mindset, problem-solving skills, and critical thinking and (III) Develop
engineering professionalism. Each course outcome links to one of those goals. These outcomes,
which are also linked to ABET-defined student outcomes, are used to define and measure the
success of each activity and learning module of the course [7]. A process of continuous
improvement of active learning techniques to achieve each course goal and demonstrate each
outcome has resulted in the effective development of our first-year engineering students [8].

For the MATLAB part of the course the student performance is assessed against ABET criterion
1 “an ability to identify, formulate, and solve complex engineering problems by applying
principles of engineering, science, and mathematics” [9] [10]. While the MATLAB workshops
are intended to equip students with skills that are useful in a classroom setting, it is also intended
to give students a glimpse into the real world. The workshops were designed to meet the
following learning objectives:
Learning Objective 1: Identify how programming and mathematics content apply to the field
of engineering.
Learning Objective 2: Understand the basics of MATLAB including that of a workspace, using
m-files, graphics, plotting, and vector manipulation.

The main components of the course (in no specific order)


• Discussion of the undergraduate engineering curriculum at Fairfield University: Faculty
guest speakers from each engineering department provided an overview of their
engineering disciplines and job opportunities.
• Individual Technical Writing: The first major writing project was an individual technical
writing (ITW) assignment. Each student selected the topic of his/her choice. This
project’s main objective was to demonstrate effective technical writing.
• Individual Oral Presentation: The second project, early in the semester, was an
individual oral presentation (IOP) of the ITW paper. This project’s objective was to
demonstrate effective oral communication of technical content.
• Writing Assignments: Writing assignments (WAs) were chosen as an assessment method
to demonstrate students’ improvements in technical writing. Individual writing
assignments included topics ranging from “Explain how something works” to “Reflect on
your speaking skills”.
• Descriptive Statistics Activity: The topics covered in this lecture include mean, standard
deviation, linear regression, significant figures, and measurement techniques.
MATLAB workshops:
The MATLAB workshops were conducted during the regular lecture meeting times and taught
by the instructor and a teaching assistant. The TAs were male or female, sophomore or junior
level engineering students, who took the course before. The lecture consisted of a introductory
section, in which the students were taught basics of MATLAB programming, and a hands-on
section, in which short programs were written by all students, followed by a choice of optional
one or two more challenging problems. The students were introduced to the MATLAB
environment including the command window, script and function files, variables assignments,
plotting, if statement, and for loop, and followed by plot function. The last lecture was about the
symbolic toolbox where students enjoyed using MATLAB to solve calculus problems. Students
were also asked to complete the Onramp MathWorks training for extra credit.
An Example of Extra Practice

Questions about how Money Grows in the Bank


1. How long does it take for money to double?
2. Does this time depend on the interest rate? How so?
3. Does this time depend on the initial deposit? How so?
Write a program in MATLAB and calculate the balance for several years. Do this:
1. for several initial deposits
2. for several interest rates

clc; clear;
d = input('Enter the initial deposit: ');
r = input('Enter the interest rate: ');
n = input('Enter the number of years for projection: ');
yr = 1;
bal = d;
disp('Year Balance');
for y = 1:n
fprintf('%5.2f %10.2f \n', y, bal);
bal = bal + bal*(1+r);
end
Your turn:
(1) Change the program to use inputs.
(2) Run the programs several times to answer the 3 questions at the top of this
page.
(3) Create the following table of results for several initial deposits.
deposit = 100;
Int rate Years to Double
5% 14
6% 12
... ...
10%
Repeat this table for initial deposits = $200, $500, $1000
The bank example is a simulation of how money grows in a bank.

MATLAB Onramp and Its Implementation

In addition to three 75-minutes lectures and three homework assignments, students could earn
extra credit for completing MATLAB’s online teaching platform – Onramp. MATLAB Onramp
is a hands-on, self-paced, free, online training course that takes about two hours to complete. It
includes eleven main topics as shown in Table I. The course starts by introducing fundamental
MATLAB commands, then focuses on importing and visualizing data. At the end students
complete a final project in which they implement their newly acquired knowledge. The final
project requires students to use MATLAB to analyze the light recorded from a star to make a
binary decision whether the star is moving towards or away from earth. In the process students
learn an important lesson about the transition from conception to implementation. In addition to
the Onramp course, there are other similar courses available in the MATLAB
academy training portal [11]. These include MATLAB Fundamentals, MATLAB for Data
Processing and visualization, MATLAB Programming Techniques, Simulink Onramp and more.
Once students complete the Onramp module, students are encouraged to tackle other modules
and thus improve their background. Upon completion of the course modules, students receive a
certificate from MathWorks. We offered an extra credit incentive to encourage students to
complete the Onramp training platform.

Topic Description

Topic Description
Commands Enter commands in MATLAB to perform
calculations and create variables
Vectors and Matrices Create MATLAB variables that contain multiple
elements
Importing Data Bring data from external files into MATLAB
Indexing into and Use indexing to extract and modify MATLAB
Modifying Arrays arrays
Array Calculations Perform calculations on entire arrays at once
Calling Functions Call functions to obtain multiple outputs
Obtaining Help Use the MATLAB documentation to discover
information about MATLAB features
Plotting Data Visualize variables using MATLAB's plotting
functions
MATLAB Scripts Write programs in script
Logical Arrays Use logical expressions in MATLAB
Final Project Bring together the introduced concepts with a
project

Table I: Main topics of MATLAB Onramp training


Student Feedback

In the fall 2020 data was collected via Blackboard from all students (41) of the four sections of
the Fundamental of Engineering course. Achievement of MATLAB workshops’ outcomes was
tracked through quantitative assessment for continuous improvement. The results are
summarized as follows:
• 80% indicated that the hands-on experience in the MATLAB workshops has caused their
confidence in their ability to succeed in Engineering to increase.
• 86.66% indicated that the MATLAB workshops have caused their understanding of
programming to increase.
• 73% believe that MATLAB will be helpful in my future engineering studies.
• During anecdotal feedback sessions, the majority of students reported that the MATLAB
Onramp training platform was very helpful.

Results of the MATLAB Workshops and Onramp

The majority of students (70% of the class) completed the Onramp training and reported that it
was very helpful in learning different aspects and features of MATL More than 80% of the
students agreed that the hands-on experience in the MATLAB workshops increased their
confidence in their ability to succeed in Engineering.
In addition to the quantitative feedback from student surveys, we also collated anecdotal student
comments. During these feedback sessions students were asked to discuss the MATLAB
workshops. These feedback sessions served as focus groups with students’ feedback used to
outline future course changes. Students discussed what they liked and what changes they
suggest. This feedback showed that students greatly benefited from MATLAB workshops and
the training provided by the Onramp platform. Most students would have liked to explore more
training content that is provided by the MATLAB training platform. We therefore plan to extend
this activity in the fall 2021 along with other suggestions.

One of the survey questions was: “What is the best aspect of the MATLAB workshops – the one
thing that should not be changed? “
A few responses stood out:

`` I particularly enjoyed our third MATLAB workshop where we were introduced to the
fundamentals of writing basic programs. I think it provided me a good introduction and skills that I
can transfer to other programming concepts. ``
`` My most memorable moment has to be when I completed my first multi-step equation with just the
coding.’’
`` I really enjoyed doing the Onramp training and using MATLAB to help solve calculus problems.
And getting the certificate``
`` Learning to solve derivatives and integrals in MATLAB. ``
My most memorable part of MATLAB was when we learned about vectors. In high school when I
took a computer science class, I wasn't able to understand vectors or how to apply them at all but
this section of MATLAB helped me understand it a lot more clearly due to the tutorials at the side.
In summary, 86.66% of the participants agreed that the hands-on activities were very interesting
and increased the student’s motivation and curiosity to explore more programing projects. These
activities also gave the students a sense of achievement. These results suggest that these
activities met the learning objectives of students learning the basics of MATLAB in the
Fundamentals of Engineering course. The results also suggest that the students’ left the
workshops motivated to explore more programming and engineering projects.
A few students found the assignments to be easy and wanted more challenging activities and
requested that the number of workshops and MathWorks training assignments be increased. A
few suggestions stood out:
``Incorporate more advanced exercises.’
``Have a sheet with all the definitions of what each character means in MATLAB
programming language.”
“Possibly have shorter assignments that do not take two hours to complete.’’
`` I really enjoyed the Onramp, that should be a required assignment for the class. Very
interesting and engaging. ‘’

All students’ feedback in addition to the faculty’s observations, will be considered for the
improvement of next year’s course.

Conclusion

The results of introducing MATLAB workshops were positive and highlighted numerous areas
for additional consideration as they relate to the content of the Fundamentals of Engineering
course. Students’ feedback was positive and shows that student opinions support incorporating
MATLAB workshops in the course. Even though the MATLAB programs demonstrated in the
workshops were elementary, they clearly showed students that MATLAB programming
provides:
1. A powerful problem-solving tool that can be applied to many types of problems.
2. An important and unique way of thinking.
3. A valuable experience with an effective industry standard tool that is useful throughout
the schooling years and subsequent career.
Results of this study show continued success in achieving course and MATLAB workshops
outcomes. We believe that the experience reported here will help our colleagues who are tasked
with course development at different universities. Further details may be provided on request.
References

[1] P. T. Goeser, W. Johnson, S. L. Bernadin, and D. A. Gajdosik-Nivens, “Work-in-Progress:


The Impact of MatLab Marina - A Virtual Learning Environment on Student Learning in a
Computing for Engineers Course”, ASEE Annual Conference and Exposition, 2013.
[2] R. Talbert, “Learning MATLAB in the Inverted Classroom”, ASEE Annual Conference and
Exposition, 2012.
[3] K. Larsen, A. Hossain And M. Weiser, “Teaching an Undergraduate Introductory MATLAB
Course: Successful Implementation for Students Learning”. ASEE Annual Conference and
Exposition, 2016.
[4] M. Rabiee, “Using MATLAB to Teach Electric Energy Courses”, ASEE Annual Conference
and Exposition, 2012.
[5] Moore, Holly. 2015. MATLAB for Engineers 4th edition. Pearson.
[6] J. J. Heeg, K. Flenar, J. A. Ross, T. Okel, T. A. Deshpande, G. W. Bucks, and K. A. Ossman,
“Effective Educational Methods for Teaching Assistants in a First-Year Engineering MATLAB
Course”, ASEE Annual Conference and Exposition, 2014.
[7] D. Belfadel, M. Arambulo, M. Zabinksi, R. Munden, and James Cavallo. “Use of the
Arduino Platform in Fundamentals of Engineering.” ASEE: Annual Conference and Exposition,
Tampa, Florida. June 2019
[8] Siegel, C. Putting the Pieces Together: Linking Learning Outcomes, Assessment, and
Curriculum. Center for Academic Excellence: Summer Institute on Integrative Learning.
Fairfield University
[9] ABET student outcomes. http://www.abet.org/accreditation/accreditation-criteria/criteria-for-
accrediting-engineering-programs-2017-2018/#outcomes
[10] Engineering Accreditation Commission. (2011). Criteria for Accrediting Engineering
Programs. Baltimore, MD: ABET
[11] Wang, C., & Sodhi, J., & Borgaonkar, A. D. (2019, July), “GIFTS – Utilizing MATLAB’s
Online Tutorial in First-Year Engineering Courses”, FYEE Conference, Penn State University,
Pennsylvania, 2019.
Appendix 1 – MATLAB WORKSHOPS Student Survey Fall 2020
True/False I understand that my choice to complete this survey will not affect
my grade.
Answers Percent Answered
TRUE 100%
FALSE 0%
Unanswered 0%
True/False I am voluntarily participating in this survey.
Answers Percent Answered
True 100%
False 0%
Unanswered 0%
Multiple Choice Overall, the MATLAB workshops have increased my interest in
engineering.
Percent Answered
Strongly agree 20.00%
Agree 33.333%
Neither agree nor disagree 33.333%
Disagree 6.666%
Strongly disagree 6.666%
Unanswered 0.00%
Sum of Agree and 53.33%
Strongly Agree
Multiple Choice Because of my experience with the MATLAB workshops, I am more
likely to continue taking courses toward a degree in engineering.
Percent Answered
Strongly agree 20.00%
Agree 33.333%
Neither agree nor disagree 40.00%
Disagree 6.666%
Strongly disagree 0.00%
Sum of Agree and 53.33%
Strongly Agree
Multiple Choice The hands-on experience with the MATLAB workshops have caused
my confidence in my ability to succeed in Engineering
Percent Answered
Increase a lot 13.333%
Increase 66.666%
No change 13.333%
Decrease 6.666%
Decrease a lot 0.000%
Unanswered 0.000%
Sum of Agree and 80.00%
Strongly Agree
Multiple Choice The MATLAB workshops have caused my understanding of
programming to
Percent Answered
Increase a lot 13.333%
Increase 73.333%
No change 6.66%
Decrease 6.66%
Decrease a lot 0.00%
Unanswered 0.000%
Sum of Increase and 86.66%
Increase a lot
Multiple Choice MATLAB will be helpful in my future engineering studies
Percent Answered
Increase a lot 20.000%
Increase 53.333%
No change 20.000%
Decrease 6.666%
Decrease a lot 0.000%
Unanswered 0.000%
Sum of Increase and 73.00%
Increase a lot

You might also like