MATLAB as a Calculator
We borrowed $1000 at a 10% annual interest rate. If we did not make a payment for two years, and assuming th
Assign the result to a variable called debt.
Script
Save Reset MATLAB Documentation (https://www.mathworks.com/help/)
1 money_borrowed=1000;
2
3 interest_rate=.10;
4
5 end_loan_of_first_year=(money_borrowed*interest_rate)+money_borrowed
6
7 new_interest=end_loan_of_first_year*interest_rate
8
9
10 debt=end_loan_of_first_year+new_interest
Run Script
Previous Assessment: All Tests Passed Submit
correct debt value?
Output
end_loan_of_first_year =
1100
new_interest =
110
https://learningtool.mathworks.com/launch 1/2
,12/13/2020 MathWorks Learning Tool
debt =
1210
https://learningtool.mathworks.com/launch 2/2
, 12/13/2020 Lesson 2 Wrap-up | Coursera
Lesson 2 Wrap-up
TOTAL POINTS 10
1. The value of a after this command: a = [0; 0; 1]' * [1 2 3; 4 5 6; 7 8 9] 1 point
[3 , 6 , 9]
[7, 8 , 9]
[3 ; 6 ; 9]
[7 ; 8; 9]
2. What will be the value of s after this command: A = [1:4; -2:2:5; 3 1 0 -1]; s = A(end- 1 point
1,end-1);
2
-1
0
We get an error message.
3. Which of the following is a valid variable name? 1 point
All of the options above are invalid.
5x2x3x
MATLAB_Rulez!
I_Hate_This_Quiz_So_Much
4. After this command: v = 111:-11:1; how many elements will v have? 1 point
11
https://www.coursera.org/learn/matlab/exam/24JUA/lesson-2-wrap-up/attempt 1/3