Question

(b) We need to evaluate the function A(x)=[5+e* |e* +e*| for very large values of x. When MATLAB is used, it gives the foll
0 0
Add a comment Improve this question Transcribed image text
Answer #1

`Hey,

Note: Brother in case of any queries, just comment in box I would be very happy to assist all your queries

This is happening because when matlab is trying to evaluate the 5+exp(x) as a part of calculation it identifies it as beyond calculation for x=720 but exp(-720) is a number which can be calculated by matlab.So, function gives inf. But, when x=750 both becomes inf and 0. So, inf*0 became an NaN.

So, to have it corrected. h(x) is (5+exp(x))*(exp(-3*x)+exp(-x))

So, expand it, h(x)=5*exp(-x) + exp(-2*x) + 5*exp(-3*x) + 1

So, now below matlab program will run fine

clc
clear all
x=[1,10,100,400,720,750];
h=@(x) 5*exp(-x) + exp(-2*x) + 5*exp(-3*x) + 1;
[x' h(x')]

MATLAB R2018a Search Documentation Log In НOME PLOTS APPS EDITOR PUBLISH VEW Insert fx Find Files Run Section Go To Compare C

Kindly revert for any queries

Thanks.

Add a comment
Know the answer?
Add Answer to:
(b) We need to evaluate the function A(x)=[5+e* |e"*" +e*| for very large values of x....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT