Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

1. Construct your own MATLAB function realizing the insertion sort algorithm.

Your function should have an unsorted array as its input and the sorted array as the output. In particular, you will need:

(i) Draw a flowchart of the function realizing the insertion sort

(ii) Write the corresponding MATLAB code. You should check (just for yourself) how your function works with an arbitrary unsorted array.

2. Write your own function computing cos(x) based on the Taylor expansion of cos(x) in the vicinity of zero. Name this function my_cos(x, N, eps). The input parameters in this function should be: x- the argument; N - the initial number of terms in the expansion; eps -optional parameter, giving the accuracy of approximation. In particular, you will need to do:

(i) Write MATLAB code for a function computing cos(x) based on the Taylor expansion with the fixed number of terms N in the expansion. Name
this function my_cos1(x,N). Draw a flowchart of my_cos1

(ii) (8 marks) Write a MATLAB code for my_cos(x,N,eps) based on the function my_cos1(x,N). 'Eps' is an optional parameter, the giving the accuracy. In other words, your function can used in two modes: my_cos(x,N,eps) and my_cos(x,N). Draw a flowchart of my_cos.

Hint: if we need to compute cos(x) with a given accuracy ?, we can truncate the infinite part of Taylor expansion cos(x)=a0+a1 x+a2 x2+... + an xn+...starting with the term an xn in case we have |an xn|

3. You are computing now the roots of a nonlinear equation f(x)=0 with the accuracy ? based on the bisection method (use Wikipedia for details about the method, section 'The method'). The given accuracy is achieved in case |f(c)|< ? , where c- is an approximate root of the equation.

You will need to construct your own MATLAB function bisect_1(fname, a, b, eps), where fname - is the name of the function; a,b, determine the initial interval for the root search; eps is the accuracy.

(i) Draw a flowchart of bisect_1(fname, a, b, eps).

(ii) Write MATLAB code for bisect_1(fname, a, b, eps).

(iii) Find all roots of the equation exp(- cos(x)) -1=0 in the interval 0

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91614999
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Question suppose we have two binary search trees b1 and b2

Question : Suppose we have two binary search trees B 1 and B 2 Give an algorithm to merge B 1 and B 2 into a single binary search tree, and runs in time linear in the sum of the sizes of the two trees. Give good justific ...

1 what is the purpose of exclusive gates such as the xor

1. What is the purpose of exclusive gates such as the XOR and XNOR? 2. What function do these gates perform?

Question need to discuss on issues and security

Question: Need to discuss on issues and security vulnerabilities caused by using 4 digit pin while accessing Banking. 1) Abstract 2) Acknowledgement 3) List of Abbreviations 4) Table of contents 5) List of tables 6) List ...

Electric car technology has been improving and the us shale

Electric car technology has been improving and the U.S. shale gas oil supply has been increasing. What will be the impact on the crude oil market price? What will be the impact on the gas-burning auto market price? Expla ...

The rooted fibonacci trees tn are defined recursively in

The rooted Fibonacci trees T n are defined recursively in the following way. T 1 and T 2 are both the rooted tree consisting of a single vertex, and for n = 3, 4, ...., the rooted tree T n is constructed from a root with ...

Question define four different conflicts you have

Question: Define four different conflicts you have encountered. These conflicts can be work related or personal conflicts. Need in APA Format, 300 words, No Plagiarism. The response must be typed, single spaced, must be ...

Question suppose you are buying stamps to put on a package

Question : Suppose you are buying stamps to put on a package at the post office. The postage required to send the package is N dollars. You can buy $1, $7, and $10 stamps. You want to find the minimum number of stamps re ...

Algorithms assignment -task -1 design and implement an

Algorithms Assignment - TASK - 1. Design and implement an efficient algorithm for determining the best route between two given stations in a given rail network. 2. The rail network should be passed to your program as an ...

What are the differences between server a mainframe and a

What are the differences between server, a mainframe, and a supercomputer? What is productively software? Name the widely used productively suite available from Microsoft?

Which sentence would work better as a thesis statement for

Which sentence would work better as a thesis statement for a three-to-five-page college paper? Remember that a thesis should be a central idea that requires supporting evidence; it should be of adequate scope for essay's ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As