Question: 4) Write a user-defined function in the form of F=fibonacci(N) to compute Fibonacci number by implementing the flowchart shown below (next page), which uses a
4) Write a user-defined function in the form of F=fibonacci(N) to compute Fibonacci number by implementing the flowchart shown below (next page), which uses a FOR loop (i.e. no recursion). Test the function for N= 1, 3.5, 10, 20, and 30.

Please answer and explain this MATLAB problem.
Also; Using the function you wrote , find Fibonacci numbers in the range of F(10)F(30) that are prime. You may use the isprime function.
N is given as an input Is N a scalar AND a non- negative integer? True False False ls N=0? True False Is N-1? True For loop Set k-2 Return F(N)--1 to indicate invalid input. Increment k by 1 False F(N)=0 F(N)-1 F(k)-F(k-1)+F(k-2) Figure 1 Flowchart of fibonacci(N) function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
