Write a MATLAB program which prints the Fibonacci series using loop. 1 1 2 3 5 8 13 21 34 …
Posted in matlab
No comments
Wednesday, July 30, 2014 By Anonymous
Write
a MATLAB program which prints the Fibonacci series using loop.
1
1 2 3 5 8 13 21 34 …
Solution:
function
QUESTION3() %Function
start
start=input('ENTER
STARTING NO: '); %Input
starting no of Fiboonaci
END=input('ENTER
ENDING NO: '); %How
many Terms Required
next=start;
disp(start);
for
n=start:END %Loop
start to end
disp(next); %Display
the series
temp=next+start;
start=next;
next=temp;
end %END
For loop
end %END
Function
Related posts
Share this post
0 comments: