Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Matlab help. I'm trying to get the # of even numbers in the first 30 fibonacci numbers. What would I change in lines 7 and

Matlab help. I'm trying to get the # of even numbers in the first 30 fibonacci numbers. What would I change in lines 7 and 12 to do this? Are there any problems with the other lines?

image text in transcribed

1 %% SCRIPT TO DETERMINE HON MANY OF THE FIRST 30 FIBONACCI NUMBERS ARE EVEN 21 n = 30 ; if = fibonacci(n); count -1 51%% s for ie:fibonacci (30) 7 if mod(f(i),2)- count-count +1; 9 end 10 end 12 final_number_of_even mod(); 13 fprintf( 'The number of even numbers in the first 30 is %d ",final-number of even); 14

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

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899