Answered step by step
Verified Expert Solution
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?
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); 14Step 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