Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Numerical method For matlab For the following equation 20 Marks fx)-1-(5 log1o x

ID: 3348860 • Letter: N

Question

Numerical method
For matlab For the following equation 20 Marks fx)-1-(5 log1o x)-x2 a. Plot the function graphically from 0 to 2 using fplot. b. Find out the average value of f(x) for x -0 to 8 and display it using fprintf. Show final result with 2 decimal digits. Hint: You have to use a for loop, mean0, log100 functions of Matlab. Vrite a function which returns determinant, transpose and square of a matrix as output. To I file for the matrix given below. 20 Marks 5410 4 6 -4 1 0 1 4 6 Hint: Square of a matrix means AA2 where A is the matrix

Explanation / Answer

clc
clear all
f=@(x) 1-5*log10(x)-x^2;
fplot(f,[0 2])

for i=1:9
    b(i)=f(i-1);
end
Avg=mean(b) % calculating average
fprintf('The average from 0 to 8 is %d ',Avg);

Answer: The average from 0 to 8 is Inf