# Problem 1  Times 2

function y = times2(x)
% Modify the line below so that the output y is twice the incoming value x
y = x*2;
% After you fix the code, press the "Submit" button, and you're on your way.
end

# Problem 2 Make the vector [1 2 3 4 5 6 7 8 9 10]

function x = oneToTen
x = [1:1:10];
end

# Problem 3. Find the sum of all the numbers of the input vector

function y = vecsum(x)
y = sum(x);
end

# Problem 4. Make a checkerboard matrix

function a = checkerboard(n)
a = ones(n);
a(1:2:n, 2:2:n) = 0;
a(2:2:n, 1:2:n) = 0;
end

# Problem 5. Triangle Numbers

function t = triangle(n)
t = sum([1:n]);
end

# Problem 6. Select every other element of a vector

function y = everyOther(x)
y = x(1:2:length(x));
end

# Problem 7. Column Removal

function B = column_removal(A,n)
A(:,n) = [] ;
B = A;
end

# Problem 8. Add two numbers

function c = add_two_numbers(a,b)
c = a+b;
end

# Problem 9. Who Has the Most Change?

function b = most_change(a)
price = [0.25; 0.05; 0.1; 0.01];
c = a*price;
b= find(c==max(c));
end

ps: 每次找index这种题都不是很顺利

# Problem 10. Determine whether a vector is monotonically increasing

function tf = mono_increase(x)
tf = true;
for i = 1:length(x)-1
result = x(i+1)>x(i);
if isequal(result, false)
tf = false;
end
end
end

08-31 219

08-24 1775

#### computer network 5th problem solutions

2018年06月08日 172KB 下载

#### CSAPP 答案-Instructor's Manual of CSAPP

2009年12月17日 231KB 下载

#### Cody's data cleaning techniques using SAS 2nd Edition

2009年08月19日 1.81MB 下载

#### COMPUTER NETWORKS

2009年09月13日 1.4MB 下载

#### computer network 5th andre problem solutions-CSDN下载

2018年03月14日 152KB 下载

#### Computer_Network 5th & Computer_Network 5th andre problem solutions

2017年11月14日 6.86MB 下载

#### computer network 5th andre problem solutions-CSDN下载.2018_03_16

2018年03月16日 152KB 下载

#### computer network 5th andre problem solutions

2012年11月22日 170KB 下载