function y = times2(x)
y = 2*x;
end
function x = oneToTen
x = [1 2 3 4 5 6 7 8 9 10];
end
function x = oneToTen
x = [1:10];
end
function a = checkerboard(n)
a = zeros(n); %构造一个全0矩阵
a(1:2:n,1:2:n)=1;
a(2:2:n,2:2:n)=1;
end
function a = checkerboard(n)
a = ones(n); %构造n*n全1矩阵
a(1:2:n,2:2:n)=0;
a(2:2:n,1:2:n)=0;
end