Fibonacci in Matlab

Published on 28 April 2022 (Updated: 25 January 2023)

Fibonacci in Matlab

Welcome to the Fibonacci in Matlab page! Here, you’ll find the source code for this program as well as a description of how the program works.

Current Solution

function f = fibonacci(n)

if ischar(n)
	error('Usage: please input the count of fibonacci numbers to output')

if n < 0
	error('Usage: please input a non-negative integer')

if not(n==round(n))
	error('Usage: please input an integer, not a floating point')

a(1) = 1;
a(2) = 1;

for i=1:n

f = mat2str(a);


Fibonacci in Matlab was written by:

If you see anything you’d like to change or update, please consider contributing.

Note: The solution shown above is the current solution in the Sample Programs repository as of Nov 05 2019 15:10:54. The solution was first committed on Oct 24 2019 15:37:31. As a result, documentation below may be outdated.

How to Implement the Solution

No ‘How to Implement the Solution’ section available. Please consider contributing.

How to Run the Solution

No ‘How to Run the Solution’ section available. Please consider contributing.