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.:- M9202777

Have any Question?


Related Questions in Computer Engineering

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

Question suppose f is a function that returns the result of

Question : Suppose f is a function that returns the result of reversing the string of symbols given as its input, and g is a function that returns the concatenation of the two strings given as its input. If x is the stri ...

Assignmentsuppose you are an isp that owns a 19 address

Assignment Suppose you are an ISP that owns a /19 address CIDR block starting at 118.235.160.0/19. Answer the following questions to allocate address blocks to 10 customers who want to pay for the smallest CIDR blocks to ...

Use the normal model n110756 for the weights of steersa

Use the Normal model ?N(1107?,56) for the weights of steers. A) What weight represents the 49th Percentile? B) What weight represents the 99th Percentile? C) What's the IQR of the weights of these steers?

There are two firms that produce large commercial airplanes

There are two firms that produce large commercial airplanes, namely, Boeing and Airbus. Boeing and Airbus have different flight control systems, with many pilots preferring one system over the other. The Airbus A380 has ...

Question you are shopping for a new computer you will be

Question: You are shopping for a new computer. You will be using the computer for everything you do, such as school, socializing, gaming, and communicating. Your total budget before tax is $1,000.00. Considerations: • Bu ...

You have an opportunity to buy a bond with a face value of

You have an opportunity to buy a bond with a face value of $10,000 and coupon rate of 14%, payable semi-annually. NOTE: Interest per 6-month period is 7% of Face Value (i.e. $10,000x0.07 = $700 per 6-month period).  (i) ...

We can represent numbers in different bases think of how

We can represent numbers in different bases. Think of how you could represent the number 5 in base 2. Essentially, how can you break the number 5 into powers of 2. It contains one 4 and one 1. In base 2, your digit overf ...

Task create an array that holds a 20 random integers

Task : Create an Array that holds a 20 random integers between 1-50. Create an iterator that will return the memory address and value for each integer present in the Array.

Two one-cent coins were weighed on an electronic balance of

Two one-cent coins were weighed on an electronic balance of high sensitivity, and an average mass per coin of 2.4918 g was obtained from the data. How could you use the same number of significant figures as the value obt ...

  • 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