Lab Report on Elements of Matlab

Surname 1
Name
Professor
Course
EXECUTIVE SUMMARY
The Lab Report demonstrates and discusses various elements of Matlab that are covered
under Matlab applications in engineering calculations. The two elements of Matlab that will be
addressed within this Lab Report include Importing data and curve fitting. The two concepts
from Matlab will comprise of an overview of the model, and the application of that concept is
applied within the Matlab software after which an example will be included to demonstrate an
understanding of the provided description.
TABLE OF CONTENTS
Executive Summary ...................................................................................................................................... 1
Introduction ................................................................................................................................................... 2
Purpose/Objectives ................................................................................................................................... 2
Lab activity Descriptions .......................................................................................................................... 2
Curve fitting .................................................................................................................................................. 2
Example .................................................................................................................................................... 3
Importing Data .............................................................................................................................................. 6
Example .................................................................................................................................................... 7
Importing filed data ................................................................................................................................... 8
Matlab Import Wizard ............................................................................................................................... 8
Conclusion .................................................................................................................................................... 9
Surname 2
INTRODUCTION
Matlab operates as an engineering calculation assisting software that utilizes various
basic but important commands. The main window for the software is presented as a command
window that contains a command prompt ‘>>’. The command window has various purposes for
instance operates as the main window, allows users to insert variables and runs programs.
However, Matlab has other windows that comprise of the editor window, workspace window and
help window among others. The software conducts various operations that curve fitting, entering
data and data series, importing data, symbolic solutions and plotting.
PURPOSE/OBJECTIVES
This Matlab software exercise was undertaken to offer insights into the application of
Matlab in engineering calculation through concentration on concepts that relate to data
calculation and curve plotting. The importing data exercise allowed students to gain familiarity
with importing data from various sources at various forms while curve fitting exercise allowed
students to understand the application of the curve fitting toolbox and how the toolbox may be
applied for engineering calculations.
LAB ACTIVITY DESCRIPTIONS
The two Matlab concepts that are being probed in this report are curve fitting and
importing data. Curve fitting influences the changes in data being fit to a particular curve.
Importing data enable users to obtain data prior to the data processing procedures.
CURVE FITTING
Curve fitting toolbox offers solutions regarding fitting curves, as well as the surface to
various data sets. Curve fitting is essential for data modeling and analysis of fitness of the curve.
Surname 3
Curve fitting utilizes functions present on the toolbox, and this includes various models for
instance the nonparametric models and nonlinear model. The toolbox assists users in carrying out
exploratory data analysis and process data at specific stages within the process of data entering
and processing. Curve fitting may be considered a hard fit, an easy fit, a bad fit or a generic fit.
An easy fit relates to the category of curve fitting in which equation for fitting the curve is
available on the curve fitting toolbox. Hard fit relates to the category of curve fitting in which the
equation for curve fitting is absent from the curve fitting toolbox. Conversely, generic fit relates
to the category of curve fitting that is utilized for exponential equations.
The polyfit command allows finding of best fit line for a collection of data points. The
polyfit command conducts the least squares fit thus minimizing errors of the data points in the
initial plotting and the fitted curve.
EXAMPLE
>> c = polyfit(x, y, d) % fit (x, y) with degree d polynomial
Surname 4
The plotted data points prior to curve fitting and joining of the data
points.
Surname 5
The joined data points although the data points do not generate the best fit line. In order
to generate the best fit line, curve fitting is required. Curve fitting will generate the best fit line
through modeling of the provided data and data points.
Surname 6
The polyfit command is applied in the establishment of the best fit line for the provided
data set. The polyfit function models the data according to the available data points to generate a
best fit line that runs from one data point to the next. However, some data points that deviate are
left out in the construction of the best fit line.
Polyval command is utilized in the assessment of polynomial for a provided collection of
x data values.
IMPORTING DATA
Prior to any processing in Matlab, users have to import data. Importing data can be
carried out in two ways that include importing data programmatically and importing data
interactively. Importing data interactively requires the utilization of the import tool. Importing
data interactively entails generating codes that allow repetition of operations for several files
Surname 7
whose data is being imported. Import Tool utilizes text files for importing data and may utilize
various file extensions for instance .txt, .asc, .dat and .tab among other file extensions. However,
the files whose content or data is being imported may be nonrectangular and may possess rows
or even column headers. The data being imported may have both nonnumeric and numeric text.
The data presented in the file extensions can be defined through one or more characters.
Importing data programmatically requires the utilization of the import function present on
the Import Tool. Majority of the import functions that allow the importing of text files
necessitate that the data fields exist in numeric form. In addition, data rows have to possess same
quantity of columns for the importing function to conduct the operation. However, certain import
functions may support header text while others enable the user to define the data range for the
data being imported.
EXAMPLE
Crop Grade for 2012
Grade 1 Grade 2 Grade 3
Houston 57 53 12
California 45 67 9
Kansas 87 23 5
The Import Tool has various import options that assist the user in determining which
option to utilize for a certain set of data. The Load Import Option cannot support range selection
Surname 8
or nonnumeric data. Dlmread Import Option supports range selection but cannot support
nonnumeric data. Import Data Option support nonnumeric data but only for the headers of the
text files. Textscan Import Option supports range selection, as well as nonnumeric data within
the text files whose content is being imported.
IMPORTING FILED DATA
1. On the Home tab, select Variable section and then Import Data.
2. Double-click the file name on the Existing Folder browser.
3. Call uiimport.
Low-level I/O functions for instance fscanf may be utilized in importing data that the import
wizard or other functions may be unable to read.
MATLAB IMPORT WIZARD
Surname 9
CONCLUSION
According to the lab report, the functions and components of the Matlab software are
essential for the utilization of the entire Matlab software, considering that a user has to import
data prior to any other activity. Secondly, curve fitting is essential for obtaining best fit curves
since it assists in modeling data according to the provided data points. Importing data utilizes
several file extensions since both nonnumeric and numeric data may be provided. Therefore, the
user has to select the import option that suits a particular data set. Importing data may occur
through two different ways that include importing data programmatically or importing data
interactively.

Place new order. It's free, fast and safe

-+
550 words

Our customers say

Customer Avatar
Jeff Curtis
USA, Student

"I'm fully satisfied with the essay I've just received. When I read it, I felt like it was exactly what I wanted to say, but couldn’t find the necessary words. Thank you!"

Customer Avatar
Ian McGregor
UK, Student

"I don’t know what I would do without your assistance! With your help, I met my deadline just in time and the work was very professional. I will be back in several days with another assignment!"

Customer Avatar
Shannon Williams
Canada, Student

"It was the perfect experience! I enjoyed working with my writer, he delivered my work on time and followed all the guidelines about the referencing and contents."

  • 5-paragraph Essay
  • Admission Essay
  • Annotated Bibliography
  • Argumentative Essay
  • Article Review
  • Assignment
  • Biography
  • Book/Movie Review
  • Business Plan
  • Case Study
  • Cause and Effect Essay
  • Classification Essay
  • Comparison Essay
  • Coursework
  • Creative Writing
  • Critical Thinking/Review
  • Deductive Essay
  • Definition Essay
  • Essay (Any Type)
  • Exploratory Essay
  • Expository Essay
  • Informal Essay
  • Literature Essay
  • Multiple Choice Question
  • Narrative Essay
  • Personal Essay
  • Persuasive Essay
  • Powerpoint Presentation
  • Reflective Writing
  • Research Essay
  • Response Essay
  • Scholarship Essay
  • Term Paper
We use cookies to provide you with the best possible experience. By using this website you are accepting the use of cookies mentioned in our Privacy Policy.