Cody

# Problem 2916. Matlab Basics II - Log and natural log

Solution 1968822

Submitted on 9 Oct 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Fail
x = [10 100 1000]; y_correct = [1.30 2.61 3.91]; assert(isequal(logarithms(x),y_correct))

y = []

Error using log Too many input arguments. Error in logarithms (line 4) y=[y round(log(x(k),2))-log10(x(k))] Error in Test1 (line 3) assert(isequal(logarithms(x),y_correct))

2   Fail
x = [50 1.2 4567; 200 67 820];; y_correct = [2.21 0.10 4.77; 3 2.38 3.8]; assert(isequal(logarithms(x),y_correct))

y = []

Error using log Too many input arguments. Error in logarithms (line 4) y=[y round(log(x(k),2))-log10(x(k))] Error in Test2 (line 3) assert(isequal(logarithms(x),y_correct))

3   Fail
x = [0.5 1.2 4.5; 23 33 3.3]; y_correct = [-0.39 0.1 0.85; 1.77 1.98 0.68]; assert(isequal(logarithms(x),y_correct))

y = []

Error using log Too many input arguments. Error in logarithms (line 4) y=[y round(log(x(k),2))-log10(x(k))] Error in Test3 (line 3) assert(isequal(logarithms(x),y_correct))