- Name your function fibseq. So call it fibseq.m, not "Fibseq.m". The case matters in Matlab.
- It will have one input n and one output f:
input and output functions
3 views (last 30 days)
Please let me know how to fix my code so that mat lab will run.
Here is my work so far:
I created a file and saved it as Fibseq.m
I created a new live script and attempted to run it.
Here is the homework prompt:
Jan on 24 Nov 2020
function f = fibseq(n)
3. Body :
f = zeros(1, n); % Pre-allocation
f(1) = 1;
f(2) = 2;
for k = 3:n
f(k) = f(k-1) + f(k-2);