Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Factorial Program - Addons and Mix-ins The factorial program is fine-we all understand its construction - we walked thru it in class I'd like

image text in transcribed

1. Factorial Program - Addons and Mix-ins The factorial program is fine-we all understand its construction - we walked thru it in class I'd like for you to design your own "add ons" to this program to .... o practice using vectors to manage inputs (so you can learn how to run experimental "cases") O run multiple cases (nested for loops) O pass information from one nested for loop in to another (or to the "outside") o practice synthesizing data from different cases in to a single graph (to learn how to move away from a raw "data dump" and tell a concise story) o practice using IF statements to evaluate data I would recommend the following Create a vector of 12 random integers (root numbers) between 1 and 50 for which you will use as the seeds to calculate the factorial for each number. If the number is odd - then the factorial program will skip calculation If the number is even then the factorial program will calculate the factorial for that rood number. If you put tic before the factorial program and toc at the end - MATLAB will calculate the time it takes for that block of code to run (need to find a way to store that after each calculation of fl) The program will then sort the factorials -pair them with their root numbers and display them in a scatter plot format Then take the sorted factorial and pair them with the time it took to calculate them -and display that as a scatter plot

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions