Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

MATLAB Coding pastrySales Do not hardcode, please use MATLAB to solve Function Name: pastrySales Inputs: 1. (double) A vector of doubles representing the bakery's profits

image text in transcribed

MATLAB Coding pastrySales

Do not hardcode, please use MATLAB to solve

Function Name: pastrySales Inputs: 1. (double) A vector of doubles representing the bakery's profits every other day Outputs: 1. (double) A vector of doubles representing the bakery's profits every day Banned Functions: interpl Topics: (interpolation). (iteration) Background: You work for Grandma's Pastry Shop. As much as you love her, her organization skills (or lack thereof) make you a bit crazy. For instance, she doesn't even know what half of the daily profits from last week are because she smudged icing on the paper! You set off on a mission to find the numbers and help Grandma get organized with your handy friend Matlab. Function Description: Given a vector of every other days' profits, estimate the profits for each missing day by averaging the profit from the day before and after it. The output vector should contain the values present in the original vector, as well as each average value placed between the two numbers that were used to find it Example: knownProfits = [50 60 44] outVes = pastry3ales (knownProfits) outVec -> 150 55 60 52 44] Notes: You will not have to worry about rounding. (All interpolated values will be integers.) The input vector is guaranteed to be at least length 2

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

Students also viewed these Databases questions

Question

=+ If strikes occur, are they legally regulated?

Answered: 1 week ago

Question

=+industrial action Under what circumstances can unions strike?

Answered: 1 week ago

Question

=+What forms of industrial action are common?

Answered: 1 week ago