Type the following commands in Matlab a 1 2 3 4 try a6 disp
Type the following commands in Matlab: \"a = [1, 2, 3, 4]; try a(6); disp[\'Good\'];catch disp(\'Bad\'); end\". What will be the output? 0 Good Bad error nothing a = [1, 2, 3, 4, 5, 6]; what will be displayed using sum(a>=3)? 1 2 3 4 5 What is the value of n after executing \"n = 1; while n = 0; x=x-4; end; What is the output of x? -2 2 0 -1 -4 If we use for i = 4:5 for j = 1:3, the statements will be executed 3 6 7 12 15 times.
Solution
1)c.bad
2)d.4
3)e.5
4)a. 0
5)d.30 times
7) c.[5 6]
8)option c
9)option c
10)b.7
11)e. -4
12)b. 6
