Write a function that takes a matrix

Assignment Help MATLAB Programming
Reference no: EM132375981

MATLAB Programming Lab Assignment - Function

To keep in mind:

Unless otherwise indicated, your function should not print anything to the Command Window. Your function may be counted incorrect if it does.

Note that you are not required to use the suggested names of input variables and output variables, but you must use the specified function names.

1. One of the tedious tasks we do in Mathematics is solve equations manually. Why not write a MATLAB code to do it for us?

Write a function my_eqn_solver that takes two input arguments A (3x3 matrix) and B (3x1 vector) (as described below), in that order, and returns the solution matrix. HINT: To solve the equation of the type:

A1X1 + A2X2 + A3X3 = B1

A4X1 + A5X2 + A6X3 = B2

A7X1 + A8X2 + A9X3 = B1

We first need to create two matrices

A1 A2 A3 B1 A

= A4 A5 A6 and B = B2

A7 A8 A9 B3

Then,

C = A-1B or A\B gives you the solution vector C (3x1 vector). Remember, it is a matrix multiplication.

Example eq: X1 +2X2 + 3X3 = 1

-X1 + 2X3 = 0

X1 + 3X2 + X3 = 0

2. Write a function called even_index that takes a matrix, M, as input argument and returns a matrix that contains only those elements of M that are in even rows and columns. In other words, it would return the elements of M at indices (2,2), (2,4), (2,6), ..., (4,2), (4,4), (4,6), ..., etc. Note that both the row and the column of an element must be even to be included in the output. The following would not be returned: (1,1), (2,1), (1,2) because either the row or the column or both are odd. As an example, if M were a 5-by-8 matrix, then the output must be 2-by-4 because the function omits rows 1, 3 and 5 of M and it also omits columns 1, 3, 5, and 7 of M.

3. Write a function called mat_extract that takes two inputs: a matrix N and a scalar nonnegative integer n, in that order, where each dimension of N is greater than or equal to n. The function returns the n-by-n square array at the top right corner of N. This might look a bit tricky, but it is worth scratching your head!

4. Write a function called sum_perimeter that computes the sum of the elements of an input matrix A that are on the "perimeter" of A. In other words, it adds together the elements that are in the first and last rows and columns. Note that the smallest dimension of A is at least 2.

Attachment:- MATLAB Programming Assignment Files.rar

Reference no: EM132375981

Questions Cloud

How would creativity in the pia assessment : How would creativity in the PIA assessment prove valuable to you as a manager within an organization?
Civil Rights Act and Age Discrimination in Employment Act : Since the passage of the Civil Rights Act in 1964, more employment legislation in the area of equal employment opportunity (EEO) has become the law of land.
How would creativity in the pia assessment prove valuable : How would creativity in the PIA assessment prove valuable to you as a manager within an organization?
Sometimes known as the key acceptance criteria : Sometimes known as the Key Acceptance Criteria (KAC) these are the 3-5 top-level acceptance results that will signify project success
Write a function that takes a matrix : EECS 138: MATLAB Programming Lab Assignment - Function. Write a function called even_index that takes a matrix
Agile schedule development : As we have seen, traditional and Agile schedule developments are quite different. Agile project management was originally developed to do software development.
Dress is used to facilitate success of social encounters : Analyze how dress is used to facilitate the success of social encounters.
Discuss?at least two risk management practices : As noted in the video, "Project Management Foundations: Risk," Risk management practice uses risk assessments to gain insight into potential risks.
What are the processes of auditing group policies : What are the processes of auditing Group policies in your organization or organization you know? Assume that you are the Security administrator in your.

Reviews

len2375981

9/24/2019 11:37:09 PM

Deliverables: If everything looks okay, rename your zip file consisting all .m files with yourfirstname_yourlastname_lab3.zip BUT remember that inside your zipped file the .m files should have the function names listed above. Submit a copy of your zip file on Blackboard under Lab Assignment #03.

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd