

%  a = [ 1 22 333]


for i=1:10
  b(i)=sin(2*pi*i/10);
end

%  b

c=1:0.1:20;

%  c(10)

%for i=1:5:44
 % fprintf(' %06d  %12.5f  \n',i,1.23e22*c(i));
%end

%d=rand(1,10)

%A = [ 1, 2 , 4;  22,44, 55;  111, 333, 999]

%B = transpose(A)

e = [1 2 3 4 5 6]
%  transpose(e)

f = rand(10,1)
f=rand(1,10)


clear;
%g = rand(4,4)
%g = rand(4,6)

%for i=1:6
 %   for j=1:4
  %      h(i,j)=g(j,i);
   % end
%end
%  h

clear;
for   c = [2 4 6 22 99]
   c
end

z = [2 4 6 22 99]
for c = z
    c
end

clear

z = ["string1" "string2" "string3"]

for s=z
    s
end


x1=0;  x2=150;  n=51;
for i=1:n
    bin(1,i)=x1+(i-1)*(x2-x1)/(n-2)
    bin(2,i)=x1+(i  )*(x2-x1)/(n-2)
end

A = importdata('lec16_grades.txt');
B=zeros(1,n);
for i=1:length(A)
    for j=1:n
    if (A(i) >= bin(1,j)) && (A(i) < bin(2,j))
       B(j)=B(j)+1;
    end
    end
    
end

%.... this is added after class to scale the x-axis properly
%     x holds the middle of each interval
for i=1:n
    x(i)=0.5*(bin(1,i)+bin(2,i));
end
bar(x,B);  title('midterm grade distribution');



