% Homework 6
% Student name:     XYZ
% Student UW NetID: XYZ 
% Student ID#:      123

% Problem 1
clear all; close all;
x = [1    3    2];
y = [6    0  2.5];
a = x+y;
save A1.dat a -ascii

b1 = x*y';
b2 = y*x';
save A2.dat b1 b2 -ascii % Save b1 and b2, in that order

% Problem 2
clear all; close all;
x = linspace(0,10,100);
y = rand(1,100);
p = polyfit(x,y,1);
yfit = polyval(p,x);
yfit = yfit';  % Transpose yfit into a column vector
save A3.dat yfit -ascii
