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

  Determine the effect of varying ax n the computed result

Determine the effect of varying Ax n the computed result for the second derivative, for the function f(x) 35 10x 4x 2 6x 3.

  Evaluate the main effects and the interaction

Do the results indicate that self-esteem is significantly higher on average for males at significance level of 0.01 - Evaluate the main effects and the interaction at a level of significance of 0.05.

  Hvac system modeling

Example: Model a scenario to show how extreme temperatures can impact the cost of energy in ($) consumption due to continuous air condition system usage. Be free to use hypothetical cases. (Modify topic or criteria as needed). Example southern US ..

  Table of hurricane categories and associated wind speeds

Review the following table of Hurricane categories and associated wind speeds (miles per hour) and storm surge levels (feet above normal).

  Read the file a line at a time

Write the modified text file with the same name as the original file, but preprended with 'new_'. For instance, if the input filename was 'data.txt', the output filename would be 'new_data.txt'.

  Prepare a project for signal and system

Prepare a project for signal and system course: do the Implementation of an AM, FM and PM Transmitter and Receiver using MATLAB. The project deliverables must include all your MATLAB codes.

  Write a program that will plot constant voltage curves

Write a program that will plot constant voltage curves for a dipole in a vacuum with inputs based on following. ( additional page to be posted on BB, bottom page 4-53 notes).

  Progrmaing i uploaded the

i uploaded the instruction. ltbrgt

  Overlap-add and overlap-save methods

Write two matlab functions to convolve two sequences using both the overlap-add and overlap-save methods

  Write down many separate letters of the alphabet in script

Write your name on graph paper, place a few points for each of the letters (chose them "wisely") and take down the coordinates of the points.

  Write a matlab script that solves ode

Write a matlab script that solves ODE: y' = 4/(1+x^2) using forward Euler's, improved Euler, classical Runge-Kutta, and Adams-Bashforth methods.

  Compute the machine epsilon for the floating point system

MTH2051/3051 Introduction to Computational Mathematics Assignment- Matlab & Finite Precision Arithmetic, Monash University, Australia. Compute machine epsilon

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