SlideShare ist ein Scribd-Unternehmen logo
1 von 2
Downloaden Sie, um offline zu lesen
Please provide the matlab code for this question. Thank you.
Consider the integral I =^1_1 exp(-x^2)dx Approximate the integral I with theMATLAB
command quadover [-1,1] and default settings otherwise. TASK:Save the resulting
approximation Iquadin the file A01.dat Approximate the integral I with the trapezoidal rule over
[-1,1] (recall that the trapezoidal rule uses only the values at -1 and 1) Approximate the integral I
with the composite trapezoidal rule and the interval [-1,1] into m = 20 sub-intervals of same
length. TASK: Save the resulting approximation Idrapin the file A03.dat.
Solution
1)))))))))
fun1 = @(x) exp(-x.^2);
A01 = integral(fun1,-1,1);
2))))))))))))
x=-1:1;
y = exp(-x.^2);
A02 = trapz(x,y);
3)))))))))))))
function integral = cmptrap(a,b,n,f)
h = (b-a)/n;
x = [a+h:h:b-h];
integral = h/2*(2*sum(feval(f,x))+feval(f,a)+feval(f,b));
%Run with
cmptrap(-1,1,20,f)
%where ’f’ is the name of the function definition file
function y = f(x)
y = exp(-x.^2);
Please provide the matlab code for this question- Thank you- Consider.docx

Weitere ähnliche Inhalte

Ähnlich wie Please provide the matlab code for this question- Thank you- Consider.docx

Higher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and FunctionsHigher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and Functionstimschmitz
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programmingAmit Rathi
 
ECE 115, Sp13 Introduction to Electrical and Computer Engi.docx
ECE  115, Sp13 Introduction to Electrical and Computer Engi.docxECE  115, Sp13 Introduction to Electrical and Computer Engi.docx
ECE 115, Sp13 Introduction to Electrical and Computer Engi.docxjacksnathalie
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsPer Kristian Lehre
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsPK Lehre
 
Tensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEsTensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEsAlexander Litvinenko
 
Exponential and logarithmic functions
Exponential and logarithmic functionsExponential and logarithmic functions
Exponential and logarithmic functionsNjabulo Nkabinde
 
A (1 )-Approximation Algorithm For The Generalized Assignment Problem
A (1 )-Approximation Algorithm For The Generalized Assignment ProblemA (1 )-Approximation Algorithm For The Generalized Assignment Problem
A (1 )-Approximation Algorithm For The Generalized Assignment ProblemCarrie Cox
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6homeworkping3
 
Module 1 Lesson 1 Remediation Notes
Module 1 Lesson 1 Remediation NotesModule 1 Lesson 1 Remediation Notes
Module 1 Lesson 1 Remediation Notestoni dimella
 
Numerical Analysis Assignment Help
Numerical Analysis Assignment HelpNumerical Analysis Assignment Help
Numerical Analysis Assignment HelpMath Homework Solver
 
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptx
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptxWEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptx
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptxExtremelyDarkness2
 
DynamicProgramming.pdf
DynamicProgramming.pdfDynamicProgramming.pdf
DynamicProgramming.pdfssuser3a8f33
 
Introduction to functions
Introduction to functionsIntroduction to functions
Introduction to functionsElkin Guillen
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxanhlodge
 

Ähnlich wie Please provide the matlab code for this question- Thank you- Consider.docx (20)

Higher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and FunctionsHigher Maths 1.2.1 - Sets and Functions
Higher Maths 1.2.1 - Sets and Functions
 
Dynamic programming
Dynamic programmingDynamic programming
Dynamic programming
 
ECE 115, Sp13 Introduction to Electrical and Computer Engi.docx
ECE  115, Sp13 Introduction to Electrical and Computer Engi.docxECE  115, Sp13 Introduction to Electrical and Computer Engi.docx
ECE 115, Sp13 Introduction to Electrical and Computer Engi.docx
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
 
Simplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution AlgorithmsSimplified Runtime Analysis of Estimation of Distribution Algorithms
Simplified Runtime Analysis of Estimation of Distribution Algorithms
 
Matlabch01
Matlabch01Matlabch01
Matlabch01
 
Tensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEsTensor train to solve stochastic PDEs
Tensor train to solve stochastic PDEs
 
Exponential and logarithmic functions
Exponential and logarithmic functionsExponential and logarithmic functions
Exponential and logarithmic functions
 
A (1 )-Approximation Algorithm For The Generalized Assignment Problem
A (1 )-Approximation Algorithm For The Generalized Assignment ProblemA (1 )-Approximation Algorithm For The Generalized Assignment Problem
A (1 )-Approximation Algorithm For The Generalized Assignment Problem
 
237654933 mathematics-t-form-6
237654933 mathematics-t-form-6237654933 mathematics-t-form-6
237654933 mathematics-t-form-6
 
Module 1 Lesson 1 Remediation Notes
Module 1 Lesson 1 Remediation NotesModule 1 Lesson 1 Remediation Notes
Module 1 Lesson 1 Remediation Notes
 
Numerical Analysis Assignment Help
Numerical Analysis Assignment HelpNumerical Analysis Assignment Help
Numerical Analysis Assignment Help
 
Numerical Analysis Assignment Help
Numerical Analysis Assignment HelpNumerical Analysis Assignment Help
Numerical Analysis Assignment Help
 
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptx
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptxWEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptx
WEEK-2-FUNCTION-AND-RELATION-EVALAUTION-OF-A-FUNCTIONS.pptx
 
DynamicProgramming.pdf
DynamicProgramming.pdfDynamicProgramming.pdf
DynamicProgramming.pdf
 
gmrit-cse
gmrit-csegmrit-cse
gmrit-cse
 
Bubble sort
Bubble sortBubble sort
Bubble sort
 
Note introductions of functions
Note introductions of functionsNote introductions of functions
Note introductions of functions
 
Introduction to functions
Introduction to functionsIntroduction to functions
Introduction to functions
 
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docxSAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
SAMPLE QUESTIONExercise 1 Consider the functionf (x,C).docx
 

Mehr von kdavid658

The next five questions pertain to the following situation- In the fig.docx
The next five questions pertain to the following situation- In the fig.docxThe next five questions pertain to the following situation- In the fig.docx
The next five questions pertain to the following situation- In the fig.docxkdavid658
 
The net income reported on the income statement is $88-648- However- a.docx
The net income reported on the income statement is $88-648- However- a.docxThe net income reported on the income statement is $88-648- However- a.docx
The net income reported on the income statement is $88-648- However- a.docxkdavid658
 
The net present value of the alternative of overhauling the present sy.docx
The net present value of the alternative of overhauling the present sy.docxThe net present value of the alternative of overhauling the present sy.docx
The net present value of the alternative of overhauling the present sy.docxkdavid658
 
The net cash provided by (used in) operating activities for the year w.docx
The net cash provided by (used in) operating activities for the year w.docxThe net cash provided by (used in) operating activities for the year w.docx
The net cash provided by (used in) operating activities for the year w.docxkdavid658
 
The names and chemical formulae of some chemical compounds are written.docx
The names and chemical formulae of some chemical compounds are written.docxThe names and chemical formulae of some chemical compounds are written.docx
The names and chemical formulae of some chemical compounds are written.docxkdavid658
 
the mother should move further away from the boy- the boy should move.docx
the mother should move further away from the boy- the boy should move.docxthe mother should move further away from the boy- the boy should move.docx
the mother should move further away from the boy- the boy should move.docxkdavid658
 
The name of a binary acid a) has no prefix b) begins with the prefix b.docx
The name of a binary acid a) has no prefix b) begins with the prefix b.docxThe name of a binary acid a) has no prefix b) begins with the prefix b.docx
The name of a binary acid a) has no prefix b) begins with the prefix b.docxkdavid658
 
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docx
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docxThe mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docx
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docxkdavid658
 
The more polar the material being dissolved in water----- The more po.docx
The more polar the material being dissolved in water-----  The more po.docxThe more polar the material being dissolved in water-----  The more po.docx
The more polar the material being dissolved in water----- The more po.docxkdavid658
 
The most relevant assertion for the audit of property- plant and equip.docx
The most relevant assertion for the audit of property- plant and equip.docxThe most relevant assertion for the audit of property- plant and equip.docx
The most relevant assertion for the audit of property- plant and equip.docxkdavid658
 
The monthly cost for health care for an employee and two dependents in.docx
The monthly cost for health care for an employee and two dependents in.docxThe monthly cost for health care for an employee and two dependents in.docx
The monthly cost for health care for an employee and two dependents in.docxkdavid658
 
the method of forecasting with leading indicators can be critizied for.docx
the method of forecasting with leading indicators can be critizied for.docxthe method of forecasting with leading indicators can be critizied for.docx
the method of forecasting with leading indicators can be critizied for.docxkdavid658
 
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docx
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docxThe molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docx
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docxkdavid658
 
The molar concentrations of two individual surfactants required to yic.docx
The molar concentrations of two individual surfactants required to yic.docxThe molar concentrations of two individual surfactants required to yic.docx
The molar concentrations of two individual surfactants required to yic.docxkdavid658
 
The molecule listed below that would have the lowest boiling point is.docx
The molecule listed below that would have the lowest boiling point is.docxThe molecule listed below that would have the lowest boiling point is.docx
The molecule listed below that would have the lowest boiling point is.docxkdavid658
 
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docx
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docxThe Modified Accelerated Cost Recovery System (MACRS) specifies which.docx
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docxkdavid658
 
The perimeter of a rectangular rug is 36 feet- The length is two feet.docx
The perimeter of a rectangular rug is 36 feet- The length is two feet.docxThe perimeter of a rectangular rug is 36 feet- The length is two feet.docx
The perimeter of a rectangular rug is 36 feet- The length is two feet.docxkdavid658
 
The producer will become more profitable by selling corn The producer.docx
The producer will become more profitable by selling corn The producer.docxThe producer will become more profitable by selling corn The producer.docx
The producer will become more profitable by selling corn The producer.docxkdavid658
 
The pressure of a gas results from O gas particles colliding with each.docx
The pressure of a gas results from O gas particles colliding with each.docxThe pressure of a gas results from O gas particles colliding with each.docx
The pressure of a gas results from O gas particles colliding with each.docxkdavid658
 
The preparations of two aqueous solutions are described in the table b.docx
The preparations of two aqueous solutions are described in the table b.docxThe preparations of two aqueous solutions are described in the table b.docx
The preparations of two aqueous solutions are described in the table b.docxkdavid658
 

Mehr von kdavid658 (20)

The next five questions pertain to the following situation- In the fig.docx
The next five questions pertain to the following situation- In the fig.docxThe next five questions pertain to the following situation- In the fig.docx
The next five questions pertain to the following situation- In the fig.docx
 
The net income reported on the income statement is $88-648- However- a.docx
The net income reported on the income statement is $88-648- However- a.docxThe net income reported on the income statement is $88-648- However- a.docx
The net income reported on the income statement is $88-648- However- a.docx
 
The net present value of the alternative of overhauling the present sy.docx
The net present value of the alternative of overhauling the present sy.docxThe net present value of the alternative of overhauling the present sy.docx
The net present value of the alternative of overhauling the present sy.docx
 
The net cash provided by (used in) operating activities for the year w.docx
The net cash provided by (used in) operating activities for the year w.docxThe net cash provided by (used in) operating activities for the year w.docx
The net cash provided by (used in) operating activities for the year w.docx
 
The names and chemical formulae of some chemical compounds are written.docx
The names and chemical formulae of some chemical compounds are written.docxThe names and chemical formulae of some chemical compounds are written.docx
The names and chemical formulae of some chemical compounds are written.docx
 
the mother should move further away from the boy- the boy should move.docx
the mother should move further away from the boy- the boy should move.docxthe mother should move further away from the boy- the boy should move.docx
the mother should move further away from the boy- the boy should move.docx
 
The name of a binary acid a) has no prefix b) begins with the prefix b.docx
The name of a binary acid a) has no prefix b) begins with the prefix b.docxThe name of a binary acid a) has no prefix b) begins with the prefix b.docx
The name of a binary acid a) has no prefix b) begins with the prefix b.docx
 
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docx
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docxThe mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docx
The mechanism above is an offset crank-slider mechanism- Dimensions ar (1).docx
 
The more polar the material being dissolved in water----- The more po.docx
The more polar the material being dissolved in water-----  The more po.docxThe more polar the material being dissolved in water-----  The more po.docx
The more polar the material being dissolved in water----- The more po.docx
 
The most relevant assertion for the audit of property- plant and equip.docx
The most relevant assertion for the audit of property- plant and equip.docxThe most relevant assertion for the audit of property- plant and equip.docx
The most relevant assertion for the audit of property- plant and equip.docx
 
The monthly cost for health care for an employee and two dependents in.docx
The monthly cost for health care for an employee and two dependents in.docxThe monthly cost for health care for an employee and two dependents in.docx
The monthly cost for health care for an employee and two dependents in.docx
 
the method of forecasting with leading indicators can be critizied for.docx
the method of forecasting with leading indicators can be critizied for.docxthe method of forecasting with leading indicators can be critizied for.docx
the method of forecasting with leading indicators can be critizied for.docx
 
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docx
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docxThe molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docx
The molarity of an aqueous solution of sodium hydroxide- NaOH- is dete.docx
 
The molar concentrations of two individual surfactants required to yic.docx
The molar concentrations of two individual surfactants required to yic.docxThe molar concentrations of two individual surfactants required to yic.docx
The molar concentrations of two individual surfactants required to yic.docx
 
The molecule listed below that would have the lowest boiling point is.docx
The molecule listed below that would have the lowest boiling point is.docxThe molecule listed below that would have the lowest boiling point is.docx
The molecule listed below that would have the lowest boiling point is.docx
 
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docx
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docxThe Modified Accelerated Cost Recovery System (MACRS) specifies which.docx
The Modified Accelerated Cost Recovery System (MACRS) specifies which.docx
 
The perimeter of a rectangular rug is 36 feet- The length is two feet.docx
The perimeter of a rectangular rug is 36 feet- The length is two feet.docxThe perimeter of a rectangular rug is 36 feet- The length is two feet.docx
The perimeter of a rectangular rug is 36 feet- The length is two feet.docx
 
The producer will become more profitable by selling corn The producer.docx
The producer will become more profitable by selling corn The producer.docxThe producer will become more profitable by selling corn The producer.docx
The producer will become more profitable by selling corn The producer.docx
 
The pressure of a gas results from O gas particles colliding with each.docx
The pressure of a gas results from O gas particles colliding with each.docxThe pressure of a gas results from O gas particles colliding with each.docx
The pressure of a gas results from O gas particles colliding with each.docx
 
The preparations of two aqueous solutions are described in the table b.docx
The preparations of two aqueous solutions are described in the table b.docxThe preparations of two aqueous solutions are described in the table b.docx
The preparations of two aqueous solutions are described in the table b.docx
 

Kürzlich hochgeladen

In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxAditiChauhan701637
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptxSandy Millin
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...raviapr7
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptxraviapr7
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxSaurabhParmar42
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.EnglishCEIPdeSigeiro
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxDr. Asif Anas
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17Celine George
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17Celine George
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxraviapr7
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxDr. Santhosh Kumar. N
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxKatherine Villaluna
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapitolTechU
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17Celine George
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxiammrhaywood
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphNetziValdelomar1
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRATanmoy Mishra
 

Kürzlich hochgeladen (20)

In - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptxIn - Vivo and In - Vitro Correlation.pptx
In - Vivo and In - Vitro Correlation.pptx
 
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
2024.03.23 What do successful readers do - Sandy Millin for PARK.pptx
 
Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...Patient Counselling. Definition of patient counseling; steps involved in pati...
Patient Counselling. Definition of patient counseling; steps involved in pati...
 
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdfPersonal Resilience in Project Management 2 - TV Edit 1a.pdf
Personal Resilience in Project Management 2 - TV Edit 1a.pdf
 
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptxClinical Pharmacy  Introduction to Clinical Pharmacy, Concept of clinical pptx
Clinical Pharmacy Introduction to Clinical Pharmacy, Concept of clinical pptx
 
CAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptxCAULIFLOWER BREEDING 1 Parmar pptx
CAULIFLOWER BREEDING 1 Parmar pptx
 
Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.Easter in the USA presentation by Chloe.
Easter in the USA presentation by Chloe.
 
Ultra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptxUltra structure and life cycle of Plasmodium.pptx
Ultra structure and life cycle of Plasmodium.pptx
 
How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17How to Add Existing Field in One2Many Tree View in Odoo 17
How to Add Existing Field in One2Many Tree View in Odoo 17
 
How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17How to Make a Field read-only in Odoo 17
How to Make a Field read-only in Odoo 17
 
Finals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quizFinals of Kant get Marx 2.0 : a general politics quiz
Finals of Kant get Marx 2.0 : a general politics quiz
 
Prelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quizPrelims of Kant get Marx 2.0: a general politics quiz
Prelims of Kant get Marx 2.0: a general politics quiz
 
Prescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptxPrescribed medication order and communication skills.pptx
Prescribed medication order and communication skills.pptx
 
M-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptxM-2- General Reactions of amino acids.pptx
M-2- General Reactions of amino acids.pptx
 
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptxPractical Research 1: Lesson 8 Writing the Thesis Statement.pptx
Practical Research 1: Lesson 8 Writing the Thesis Statement.pptx
 
CapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptxCapTechU Doctoral Presentation -March 2024 slides.pptx
CapTechU Doctoral Presentation -March 2024 slides.pptx
 
How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17How to Add a New Field in Existing Kanban View in Odoo 17
How to Add a New Field in Existing Kanban View in Odoo 17
 
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptxAUDIENCE THEORY -- FANDOM -- JENKINS.pptx
AUDIENCE THEORY -- FANDOM -- JENKINS.pptx
 
Presentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a ParagraphPresentation on the Basics of Writing. Writing a Paragraph
Presentation on the Basics of Writing. Writing a Paragraph
 
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRADUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
DUST OF SNOW_BY ROBERT FROST_EDITED BY_ TANMOY MISHRA
 

Please provide the matlab code for this question- Thank you- Consider.docx

  • 1. Please provide the matlab code for this question. Thank you. Consider the integral I =^1_1 exp(-x^2)dx Approximate the integral I with theMATLAB command quadover [-1,1] and default settings otherwise. TASK:Save the resulting approximation Iquadin the file A01.dat Approximate the integral I with the trapezoidal rule over [-1,1] (recall that the trapezoidal rule uses only the values at -1 and 1) Approximate the integral I with the composite trapezoidal rule and the interval [-1,1] into m = 20 sub-intervals of same length. TASK: Save the resulting approximation Idrapin the file A03.dat. Solution 1))))))))) fun1 = @(x) exp(-x.^2); A01 = integral(fun1,-1,1); 2)))))))))))) x=-1:1; y = exp(-x.^2); A02 = trapz(x,y); 3))))))))))))) function integral = cmptrap(a,b,n,f) h = (b-a)/n; x = [a+h:h:b-h]; integral = h/2*(2*sum(feval(f,x))+feval(f,a)+feval(f,b)); %Run with cmptrap(-1,1,20,f) %where ’f’ is the name of the function definition file function y = f(x) y = exp(-x.^2);