Matlab Basics
% Input mat r i c e s A and B
A = [ 2 59 2 5 ; 41 11 0 4 ; 18 2 3 9 ; 6 23 27 1 0 ; 5 8 5 1 ] ;
B = [ 0 , 1 , 0 , 1 ; 0 , 1 , 1 , 1 ; 0 , 0 , 0 , 1 ; 1 , 1 , 0 , 1 ; 0 , 1 , 0 , 0 ] ;
% Pointwi s e mul t iply A with B and s e t i t to C
C = A.*B;
disp (C) ;
%Calculate the inner product of 2nd row and 5th row of C and store result in inner_prod
inner_prod = C(2,:)*C(5,:)';
disp(inner_prod);
% Find maximum and minimum value in C
max_val_C = max(C(:));
min_val_C = min(C(:));
% Find indices corresponding to maximum and minimum values in C
[max_val_indices_C(:,1), max_val_indices_C(:,2)] = find(C == max_val_C);
[min_val_indices_C(:,1), min_val_indices_C(:,2)] = find(C == min_val_C);