**Please use MATLAB**
11)Function: Create a function that takes inputs “x” and “z” and generates any random matrix of dimension “x” or “z”, whichever is larger.
12)Function: Create a function that takes a generic matrix, x, and finds the smallest value in the matrix. The function must work for matrices of any size or dimension.
**Please use MATLAB**
Also, please include code used for the function. I have tried several times but have been unsuccessful.
11)
function Code
function y = large_mat(x,z)
if(x>z)
y = rand(x);
else
y = rand(z);
end
==============================
Command line code to execute above function
x = input('Enter value for x: ');
z = input('Enter value for z: ');
y = large_mat(x,z);
================================
result
Q12)
Function Code
function y = small_val(x)
[r,c] = find(x==min(x));
y = x(r,c);
end
================================
Command line code
x = input('Enter matrix x: ');
y = small_val(x);
===========================
Results
=========================================
Get Answers For Free
Most questions answered within 1 hours.