0% found this document useful (0 votes)
31 views

Home Assignment

The document outlines 5 MATLAB coding tasks: 1. Write code for the Secant Method and Fixed Point Iteration Method to calculate approximate error at each step and show error propagation graphically. 2. Write a function called LCM_my that takes two numbers as input and returns their LCM. 3. Write a function called Check_max_min_point that takes 3 inputs a, b, c, evaluates the derivatives of a function f at those points, and comments on whether it is a max/min point.

Uploaded by

shahnewaz.eee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Home Assignment

The document outlines 5 MATLAB coding tasks: 1. Write code for the Secant Method and Fixed Point Iteration Method to calculate approximate error at each step and show error propagation graphically. 2. Write a function called LCM_my that takes two numbers as input and returns their LCM. 3. Write a function called Check_max_min_point that takes 3 inputs a, b, c, evaluates the derivatives of a function f at those points, and comments on whether it is a max/min point.

Uploaded by

shahnewaz.eee
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

1. Write down a MATLAB code for Secant Method.

Calculate approximate error for each step and


show graphical presentation of error propagation.
2. Write down a MATLAB code for Fixed Point Iteration Method. Calculate approximate error for
each step and show graphical presentation of error propagation.
3. Write down a MATLAB code to determine LCM of two numbers. Check the attached figure to
know how to calculate LCM of two numbers.

4. Now make your problem -3 code an 'user defined function' in MATLAB named LCM_my(x,y).
That means this function will take two numbers as input and give the result of LCM of these as
output.

Example:

>> LCM_my(10, 12)

>> 60

5. Write down a user defined function named 'Check_max_min_point (a,b,c)' that will take three
inputs values of a, b and c and evaluate the first derivative of f with respect to x, y and z as fx, fy
and fz respectively at (a,b,c) point where f is as follows.
3 -x
f = 3ysin x + 2yln(z-1) – 3e
If fx, fy and fz all are zero then it will show comment as
'This is the max/min point in the function'
and if any of them are non zero, then it will show the comment
'This is not the max/min point of the function'

Example:

>> Check_max_min_point(2,3,4)

This is not the min/max point

>> Check_max_min_point(0,1,0)

This is not the min/max point

>> Check_max_min_point(0,0,0)
This is not the min/max point

You might also like