Question

Problem 3. Consider the running integral dx 0s xs3 Determine: (a) the exact value over the domain, (b) the zero-order approx

USE MATLAB

0 0
Add a comment Improve this question Transcribed image text
Answer #1

clc;
clear all;
y=linspace(0,3,100); %y is input
z=zeros(1,100);
syms x;
%a)
fun= x*exp(-(x^2));
for i=1:100
C= int(fun,0,y(i));
z(i)=vpa(C);
end   
% z is exact value

%b) zero order approximation (zoa)
zoa=mean(z);

%c) first order approximation (foa)
P=polyfit(y,z,1);
%P(1) is slope and P(2) is constant term:::P(1)x+P(2)
%d) plot
plot(y,z,'ro');
hold on;
plot(y,z);

if you have any doubt please write it in comment box

Add a comment
Know the answer?
Add Answer to:
USE MATLAB Problem 3. Consider the running integral 'dx 0s xs3 Determine: (a) the exact value...
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