MatLab questions
Construct a 3 by 3 matrix consisting of random positive integers. Find the maximum and minimum elements of this matrix Sort the values of vector b (defined in #2). Plot f(x) 2x^2+8x-3 for x from -10 to 10 in a green dashed line. Label x-axis as \"x\" and label y-axis as \"f(x)\" Also plot x- and y-axes to estimate the zeros of this function. Graph f(z) sin(z) and f(z) cos(z) in the another plot for z 2m to 2m. Create a legend so that each plot is clearly identifiable. Plot sin(z) with a dashed magenta line. Plot cos(z) with a solid blue line that is thicker than the plot of sin(z). Modify the function log6(x) so instead having the absolute value within the logarithm, your function should check if the input is negative or zero and print out an appropriate message saying that and then terminate. If input is positive, it should calculate the logarithm base 6 of input. Write a function m-file called div6.m that takes as input a real number and checks to see if it\'s divisible by 6 and let user know whether it is or is no. Using the bisection method, write a function that can solve for x when given the following polynomial equation: f(x) = x^3 -4. Make use of plotting capabilities to get guesses for x values. Note that your input will be guesses for x and you will have to define a tolerance for when the function should stop applying the bisection method and give an answer. Try to What solutions for x does your function give when f(x) = x^3 -4?
As per chegg policy I am solving only 3 questions:
8)
9)
MAX=X(1,1);
for i=1:3
for j=1:3
if MAX<= X(i,j);
MAX=X(i,j);
end
end
end
disp(MAX)
3)
v=rand[100:1];
v1=sort(v); % inbuild sort function in matlab.