logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

What are the following brackets typically used for in MATLAB? If I create a new variable by typing “a = 5”, MATLAB will create a variable called “a” of type:

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS
  1. What are the following brackets typically used for in MATLAB?

 

  1. ( )
  2. [ ]
  3. { }
  4. < >

 

  1. If I create a new variable by typing “a = 5”, MATLAB will create a variable called “a” of type:
  1. Integer
  2. Double
  3. Character
  4. Unsigned integer

 

  1. A matrix D is of size 5x9. How do I access the element in the 3rd row and 5th column?

 

  1. True or False? If false, provide the correct answer: I can create a break point anywhere I want in my MATLAB script.

 

  1. True or False? If false, provide the correct answer: I cannot pass arrays to functions as input or output arguments.

 

  1. Are the variables in a function accessible to you, i.e. are they visible in the workspace? Explain.

 

  1. Does an “if” statement need an else portion? Explain.

 

  1. Does a function always need to return a variable back to where it is called from? Explain.

 

  1. What is the difference between a regular array and a cell array? Explain with an example.

 

  1. What do I need to do if I want to plot 5 plots on the same figure as shown? Write the command for each plot. (Don’t worry about the contents of the plot or the axes)

 

  1. What is the difference between a “for” loop and a “while” loop? Explain with an example.

 

  1. Is there a way to see the value of a variable while the program is being executed (without printing it in the command window or to a file)? Explain.

 

  1. Is the following set of code correct for calling a function from the main script? If not, correct it. (Note: There can be more than one error)

 

  1. Where would you write your MATLAB script – in the command window or the editor? Why?

 

  1. Can a function call other functions? Explain with an example.

 

  1. Explain if the following functions are correct. If not, explain why

 

  1. When reading data from a text file, how will you specify the different data types to be read in? If a file has the decimal numbers in the first 3 columns and text in the next two columns, what would the command be?

 

  1. How do we specify the linewidth and fontsize when plotting data as a simple line plot?

 

  1. Say I plot the same data using two different styles (for example, plotting with straight lines and using dashed lines), how many data entries will appear if I ask MATLAB to insert a legend in the plot? Can I make the legend show only one entry? If so, how?

 

  1. Explain the steps and the MATLAB commands that I would have to follow to (i) read in data from a

MATLAB .mat file, (ii) plot the data in MATLAB and (iii) save the data to an excel file 

 

  1. Coding question:

Gait analysis is the study of human motion with the aim of assessing and treating people with conditions that affect their ability to walk normally. One way to measure human motion is to attach markers to a person’s joints, (eg. Hip, knee and ankle) and optically track them using cameras while the person walks (as shown in the image).

 

Using the data obtained from tracking these markers, important information regarding the person’s gait, or walking motion, can be derived. 

 

The attached file “joint_flexion.mat” contains data for markers at the hip, knee and ankle for a patient with a neurological disorder while walking. The file has the following variables:

  • times: The timings of the flexion values in seconds
  • angles: A matrix in which the first column represents flexion (i.e. angle) of the left hip, the second column is the flexion of the left knee and the third column is the flexion of the left ankle.
  • foot_off: An array containing the timings (in seconds) of ‘foot off’ events, i.e. when the toe leaves the ground
  • foot_strike: An array containing the timings (in seconds) of ‘foot strike’ events, i.e. when the heel hits the ground
    1. Part I: Write a script that has a function to read in the MATLAB file and save the information into separate variables. You can name the variables as you see fit. (10 points)
    2. Part II: Write a function to calculate the following (15 points)
      1. Range of angles (i.e. maximum – minimum) for the hip, knee and ankle
      2. Maximum value of the angles and the time at which the maximum occurs
    3. Part III: Write a function to create a plot of joint flexion versus time for all three joints on the same figure. Add lines indicating the timings of the ‘foot off’ and ‘foot strike’ events, and a legend. Use a linewidth of 3 and a fontsize of 14 for the figure. The plot should look similar to the one shown here (you can use any color of your choice): (15 points)

 

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Atharva PatilComputer science

536 Answers

Hire Me
expert
Chrisantus MakokhaComputer science

530 Answers

Hire Me
expert
AyooluwaEducation

867 Answers

Hire Me
expert
RIZWANAMathematics

964 Answers

Hire Me

Get Free Quote!

378 Experts Online