Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1.) In a MATLAB script, create an array of the first few Fibonacci numbers: fib_list = [1,1,2,3,5,8,13,21,34,55, 89, 144]. Write a short script which uses
1.) In a MATLAB script, create an array of the first few Fibonacci numbers: fib_list = [1,1,2,3,5,8,13,21,34,55, 89, 144]. Write a short script which uses a loop and a conditional if...end statement to count the number of entries in this list which are even and the number of entries which are odd. (Yes, I know you can count them yourself without MATLAB, but you're building a tool which could work on a list of millions of numbers so you wouldn't have to count it by hand). Have your script output the result for both the number of even entries and the number of odd entries in the command window. Publish a PDF of your code, print it out, and and turn it in with this pre-lab assignment
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started