Question

MATLAB CODE: Matlab’s polyder() and polyint() functions return the derivative and integral of a polynomial, respectively....

MATLAB CODE:

Matlab’s polyder() and polyint() functions return the derivative and integral of a polynomial, respectively. For example, polyder([4 -2 3 7 -5]) yields [16 -6 6 7] in other words: d/dx{4x4−2x3 +3x2+7x−5} = 16x3−6x2 +6x+7and,polyint([16 -6 6 7]) yields [4 -2 3 7 0] note the zero at the end. in other words:∫(16x3-6x2+6x+7)=4x4–2x3+ 3x2+7x+? where C = 0

As seen above, the constant of integration is always assumed to be zero when using polyint().While polyint() is available, using your knowledge of Matlab arrays (and basic calculus), you should be able to write a simple, single line statement – without using polyint() – which will also calculate an array with the coefficients of the integral of an arbitrary polynomial. To be explicit, suppose that p is an arbitrary array of any length defined in the Matlab workspace. If we then write intp = <stuff>; determine what <stuff> should be so that intp will be an array with the coefficients of the integral of the polynomial represented by p. For example if p=[16 -6 6 7] your calculation should give intp=[4 -2 3 7 0] (noting again that the constant of integration is zero). Try generating additional examples, with different length p arrays, and compare your code to the output of polyint() to verify the code. We will check your work with a different array p when you are ready, but you cannot change the statement you use to calculate intp when we check; your code must work unchanged with an entirely different, completely unknown array p. Use up-arrow to recall your previous statement after entering the new p.

I'm getting a little lost. I think I have majority of it but I'm not sure.

Homework Answers

Answer #1

intp=[p./(length(p):-1:1) 0]

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
PLEASE CODE EVERYTHING IN C++ Quick Thinking: Arrays Objective: Test your knowledge in providing efficient solutions...
PLEASE CODE EVERYTHING IN C++ Quick Thinking: Arrays Objective: Test your knowledge in providing efficient solutions for operations on arrays. What you can use only: Loops These variables only const int SIZE = 4; int variable = 0, master array [SIZE][SIZE]; double average = 0.0, parallel array [SIZE]; One conditional statement per problem if needed Note: the conditional statement cannot contain an “else” or “else if’ Provide solutions to the following problem. Absolutely no hard coding can be used. ----------------------------------------------------------------------------------------------------------------------------------------------------------...
**please write code with function definition taking in input and use given variable names** for e.g....
**please write code with function definition taking in input and use given variable names** for e.g. List matchNames(List inputNames, List secRecords) Java or Python Please Note:    * The function is expected to return a STRING_ARRAY.      * The function accepts following parameters:      *  1. STRING_ARRAY inputNames      *  2. STRING_ARRAY secRecords      */ Problem Statement Introduction Imagine you are helping the Security Exchange Commission (SEC) respond to anonymous tips. One of the biggest problems the team faces is handling the transcription of the companies reported...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT