Question
Use in MATLab
(b) Write a computer program to calculate ex as an approximate series summation, to an accuracy of 1010. The value of x shoul
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Matlab Code:

clear;clc;
%taking input of x
x = input('enter the value of x:');
% calling the function to find the value
F = exponential(x);

function val = exponential(x)
i = 0;a = -x^3;
%actual value of the function
actual_val = exp(-x^3);
err = 1;
%summation of the function while checking error
val = 0;
while err > 10^(-10)
val = val + (a^i)/(factorial(i));
err = abs(actual_val-val);
i = i+1;
end
  
end

Add a comment
Know the answer?
Add Answer to:
Use in MATLab (b) Write a computer program to calculate ex as an approximate series summation, to an accuracy of 101...
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