Question: This must be answered using matlab 2. (12pts) The code below contains exactly six errors. For each error: (1) circle the error, (2) write a
2. (12pts) The code below contains exactly six errors. For each error: (1) circle the error, (2) write a modification of the code that "fixes the error (there are multiple ways to fix each error - just make a change that allows the code to run without generating an error). You do not need to indicate the error message that MATLAB prints. disp("find the sum") number=100; numbersum=3number+2; disp ("Matrix operation and modification") mat=(1:3; 2:4; 11 12 13; 31 32 38]; A-mat (1:3, 2:3); B-mat (2:4, 2:3); C=A*B; mat(1, 2)=[1 2]; disp ("Set money for occupations!") disp("A. Banker") disp ("B. Teacher ") user_input - input('Enter the letter A Or B', 's'); if user input = 'A' money = 4000; occupation Banker: else money- 3000; occupation-"Teacher"; end disp (mooney)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
