% NCIAE
% Computer Applications for Engineers
% Assignment 2

close all; clear; clc


% Problem Data

% Problem 9.6
starting_numbers = [1 3];


% Place your code for problem 9.3 below this line

squares = zeros(1, 5);
for i = 1:5
    squares(i) = i^2;
end

a_9_3 = squares; % Assign your answer to problem 9.3 to this variable


% Place your code for problem 9.4 below this line

squares = zeros(1, 5);
i = 1;
while i <= 5
    squares(i) = i^2;
    i = i + 1;
end

a_9_4 = squares; % Assign your answer to problem 9.4 to this variable


% Place your code for problem 9.6 below this line

fib = zeros(1, 12);
fib(1:2) = starting_numbers;
for i = 1:10
    fib(i+2) = fib(i+1) + fib(i);
end

a_9_6 = fib; % Assign the array of fibinacci seguence values to this variable
