Write a function that takes a square matrix

Assignment Help MATLAB Programming
Reference no: EM132262725

Question 1:

Write a function that takes in as input, two vectors, say, x_ and y_ of any length n. Your output should be the dot product x_·y_. The first line of your function should look like

function vecproduct = dot (x , y )

Question 2:

Write a function that takes in as input, a vector, say x_. Your output should then be a vector containing the norm 1, norm 2 and norm infinity of the vector in the specified order, denoted respectively as ||·||2, ||·||2 and ||·||. The first line of your function should look like
function [ norm1 norm2 norminf ]=norm( x )

Question 3:

The Lab questions below are from Chapter 2.

We will begin with a very simple one. Write a function that takes a square matrix, say A, that is odd as an input. This function must add up the edge elements of the matrix, and then multiply the answer obtained with the middle column vector of the matrix. The first line of your function should look like:

function Ans= MatrixFun (A)

Question 4:

Write a function that takes in a non-negative integer n as an input. The function must generate a matrix of size n × n, where all the values in the matrix are zero except for those in the diagonal. The diagonal entries satisfy the relation aii = i. The output matrix when n = 4 looks like:

493_matrix.jpg

The first line of your code should look like:

function A= MatrixDia (n)

Reference no: EM132262725

Questions Cloud

What are three of the interconnected leadership tasks : What are three of the interconnected leadership tasks for strategic planning and implementation that you found most interesting? Tell me what each of these.
The nature of organization environments : Discuss the structure of your work environment using principles and concepts from this week's readings. Also, considering the process of delegation
Explain what each process means that you picked : MGMT414 Pick five of the the leadership tasks that are listed on page 357 of our text. Tell me why each task is important to understand as a leader.
Determine the process capability index : Mean 328.8 Standard Dev 6.3 Lower Spec 313.4 Upper Spec 344.2 Determine the process' capability index.
Write a function that takes a square matrix : Write a function that takes a square matrix, say A, that is odd as an input. This function must add up the edge elements of the matrix
What is the concept of universal design : What did you learn by watching the videos with description? Did you gain any insights into what is important, culturally, to describe?
Context-sensory stimuli affect design of retail environment : How might context and sensory stimuli affect the design of a retail environment?
Describe how you would manage the situation : Describe how you would manage the situation. Your response should take the form of a 4 page double spaced essay, which should demonstrate through a minimum.
Kanban system to make plastic wheels : The Edward James Toy Company uses a Kanban system to make a plastic wheels that are a component of several toys.

Reviews

len2262725

3/21/2019 10:02:10 PM

Students should note that they are only to submit the published pdfs containing their codes on sakai. There will be no input given to you on which to test your functions. Students should ensure that they do the necessary tests before submitting on sakai. You can only resubmit on sakai three times. For each lab question, students should publish their code. For the current lab, students will have four published codes corresponding to the four questions. These can be put in a folder and zipped and uploaded into sakai.

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