Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab Function Name: pascalsPodium Inputs: 1. (double) The number of rows to include in your output 1. (double) An array representing the podium Banned Functions:

Matlab

image text in transcribed

Function Name: pascalsPodium Inputs: 1. (double) The number of rows to include in your output 1. (double) An array representing the podium Banned Functions: nchoosek(, pascal) Background You have been hired by the International Olympic Committee to design the closing ceremonies. You and your team have all the flower bouquets picked out, ordered the medals, and purchased all the streamers and confetti, but still have one extremely important task: designing the podium. Reminiscing back to high school calculus, you remember learning about Pascal's triangle and decide it would be the perfect starting point to constructing the Olympic podium. However, mapping out rows and rows of blocks to recreate Pascal's triangle can be tedious, so you choose to use your amazing MATLAB skills to do it for you. Function Description: Given the number of rows of Pascal's triangle to include in your final output, build a double array containing the triangle, with zeros filling the spaces in between. For example, the first four rows of Pascal's triangle are usually written in the following fashion: 1 3 3 1 Since the rows of the triangle are offset from one another, our MATLAB representation of the triangle will include zeros to fill the gaps. So we can show the first four rows of the triangle as the following 4x7 double array: 3 1 Each row of Pascal's triangle is constructed by summing adjacent elements of the row above it. For example, to find the value of a certain position, go to the position directly above it (the previous row) and sum the values directly to the right and left of it. Homework 07 -Iteration Given this, you can create the array by starting with the first row (it will always be a single 1 in the center of the row), and iterating through the rest of the rows, using the elements of the previous row to create each subsequent row Notes: Inputs to this function will be integers greater than 1

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions

Question

Design a training session to maximize learning. page 296

Answered: 1 week ago

Question

Design a cross-cultural preparation program. page 300

Answered: 1 week ago