mirror of
https://bitbucket.org/Mattrixwv/octavefunctions.git
synced 2025-12-07 03:03:57 -05:00
Added code to cleanup the variables at the end of the script
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
fib = [1, 1, 2]; %Holds the Fibonacci numbers
|
||||
currentFib = fib(end) + fib(end - 1); %The current Fibonacci number to be tested
|
||||
evenFib = [2]; %A subset of the even Fibonacci numbers
|
||||
finalSum = 0;
|
||||
|
||||
while(currentFib < 4000000)
|
||||
%Add the number to the list
|
||||
@@ -20,5 +19,9 @@ while(currentFib < 4000000)
|
||||
currentFib = fib(end) + fib(end - 1);
|
||||
end
|
||||
|
||||
finalSum = sum(evenFib);
|
||||
finalSum
|
||||
sum(evenFib)
|
||||
|
||||
%Cleanup your variables
|
||||
clear fib;
|
||||
clear currentFib;
|
||||
clear evenFib;
|
||||
|
||||
Reference in New Issue
Block a user