a) C=A*B is a matrix multiplication and result is 2*2 matrix
C = [38 17; 26 14]
b) D=A.*B is element wise multiplication corresponding elements in each matrix will be multiplied
D = [ 3 21; 10 8] i.e [1*3 7*3 ; 2*5 4*2]
(10 pts Question 6: What will be displayed when you run the code below >> A...
You have the matrix below: a) 9 10 11 12 What will be displayed by the code: A(2:3,2:3) What will be displayed when you run the code below? b) a-0 while a<10 aa+3: end disp (a) d) Give the steps to find the roots of the following linear equation using MATLAB. rs + 2x4-5x3 + 7x2 + 12x + 20 = 0 a) Give MATLAB commands to plot, on the same figure, the two functions: f(t) = 3t2 +2t-0.5 g(c)-2t...
what will be printed when you run below code in python? age=6 age=(age**2)//2 print(age) if (age >25) print("You will pay $120 per month") print("check date:") elif(age >=16) print("You will pay $90 per month") else: print("You will pay $50") print("Check payment due date") print(" Your payment is due by Oct 2019")
What is the final value of x in memory after the code below is run? 1 int x; 2 for (x=0; x<5; x++){ 3 4} Answer: Answer What is the result of the following bitwise operation in decimal? ((~6)&36)|(6)&(~36)), where ~, |, and & are the bitwise NOT, OR, and AND respectively. Answer: Answer Complete the attempt to allocate a 5-element array of pointers to doubles and initialise the associated double value to 0.0. double* a[10]; for (int j =...
Please show all handwritten steps Exercise 4 (2 pts): When run, the following MATLAB code produces one of the four images shown below. Circle the image that is produced by the MATLAB code: (SHOW WORK!) clear:clc A (5, 5) 0 mycolormap= [10 0; 0: 011 colormap (mycolormap) for m 1:5 for n = 1:5 A (m, n) mod (m+n, 5) end end imagesc (A) axis square A) B) c) D)
QUESTION 10 What will be the output of following code snippet? char *str; str = "%s"; printf(str, "S"); A. S B. Garbage Value C. Compile-time Error D. Run-time Error 4 points QUESTION 11 What will be the output of the following statements assuming that the array begins at the memory address location 7002 and size of an integer is 4 bytes? int a[3][4] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 }; printf("%d,...
5. (6 pts) What is the outputs of following section of a program? int a[10] = {1,2,3,2, 5, 6, 7, 8 , 9, y): int i - 0, 30: while (i<10) coutくく3くくendl ; 6. (6 pts) What is output of following set of instructions in a C++ program: (In this problem both x and y represent positive integers) int a[10]={-1, 3=0; 2, 7, -4, 11, -2, 3, -9); x, -y, int for (int i-0:i<10:i++) if (a [1]<0) s+ai] coutくく3(くend-; 7....
QUESTION 8 What (if anything) will be the output of the following code: int count = 3; while (count++ <= 6) { System.out.print(++count + " "); } 3 4 5 6 4 5 6 7 3 4 5 6 7 5 7 4 6 The above code contains a syntax error and will not run. 8 points QUESTION 9 What (if anything) will be the output of the following code: int count = 0; while (count < 5) {...
QUESTION 1 What will be displayed as a result of executing the following code? int x = 5, y = 20; x += 32; y /= 4; cout <<"x = " << x <<"y = " << y; A. x = 32, y = 4 B. x = 9, y = 52 C. x = 37, y = 5 D. x = 160, y = 80 8 points QUESTION 2 What will be the displayed when the following code...
7 Question 27 4 pts What is displayed by this program? #include <stdio.h> void seven(int *xPtr); int main(void) int x,y: X-5: y = 6: seven(&x): seven(&y): printf("%4d%4d\n", x,y); return(0); void seven(int "xPtr) inty: y -'xPtr+2; *xPtry3; (Show blank spaces with asterisks)
5) What is the value of the variable answer after the code segment below completes? int a, b, c; answer, a 3*b: b 5 10: c (a a b*b) / (c*c) answer = A).5 B) 2 C) 2.5 D) 250 ENone of the Above 8) What is the output of the following segment of code? int a 7, b= 3, c = 6 if (a> b c) printf"A"); if (b > a - с) printf ("B"); else printf("C") if (atb...