Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Function name: pascalsPodium. Need the MATLAB code for this! Function Name: pascalsPodium Inputs 1. (double) The number of rows to include in your output Outputs:

Function name: pascalsPodium. Need the MATLAB code for this!

image text in transcribedimage text in transcribed

Function Name: pascalsPodium Inputs 1. (double) The number of rows to include in your output Outputs: 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 331 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: 1 2 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. Continued

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

Spatial Databases A Tour

Authors: Shashi Shekhar, Sanjay Chawla

1st Edition

0130174807, 978-0130174802

More Books

Students also viewed these Databases questions