Fibonacci series in MATLAB without built-in function | MATLAB for Beginners

preview_player
Показать описание
Code:

x=input('Enter the number:');
a=1
b=1
for i=1:x
c=a+b
a=b;
b=c;
i=i+1;
end
Рекомендации по теме
Комментарии
Автор

No need to give i=i+1 at the end of the loop.In matlab i=1:x will take care of that..but if you are working with java then you have to write that.

KnowledgeAmplifier
Автор

Please put a=1
Then it will give the proper Fibonacci sequence

somnathghosh_
Автор

Can you please tell me how do I find out the n positioned number? I have to start the counting from V(1)=1 V(2)=1 V(3)=2 and so on. I'd really appreciate!^^

jurcutvlad
Автор

Tell me please How can i do it by using while loop ??

زهرةاللوتس-سب
welcome to shbcf.ru