Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need assistance creating a separate project M file for each of the 4 functions below. do not try and find matlab functions which do

I need assistance creating a separate project M file for each of the 4 functions below. do not try and find matlab functions which do these things for you, i am attempting to practice using simple code. the functions should print nothing (no disp and please use semicolons to suppress calculation outputs) only return the value requested.

Thank you!

image text in transcribedimage text in transcribed
The Function M-Files: 1. mypiecewise (a,b) which takes two inputs: a: A real number. b: A real number. Does: o If a. b return sin (a), assume a. is in radians. Returns: As above. 2. myfunctionsumtf ,m,d) which takes three inputs: 1?: A function handle. m: A real number. (1: A real number. Does: Calculates the sum mf(m) + (m + d)f(m + d) + (m + 2d)f(m + 2d)... + (m + 38d)f(m + 38d). Returns: This sum. 3. myfunctionchecktf ,a,d,M) which takes four inputs: :f: A function handle. a: A real number. (1: A real number. M: A real number. Note: You may assume that f (a) a. Does: Checks f(m) for a: = a, a: = 0,9- d, a: : (5+ 2d, a: = a + 3d, until f(m) Z M. Returns: The rst xvalue checked satisfying f(;c) 2 M. 4. myimproperintegral(f,b,t) which takes four inputs: 1': A function handle. b: A real number. 1:: A real number. Note: You may assume that f (0) is undened but that the imprOper integral f; f(:i:)d:1: exists. You may also assume I) > % Does: Calculates b b :5 f( mm, \"mm, f(a:)da:,... 21) (23) (23) until successive integrals differ by less than 1;. Returns: The nal calculated integral

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Statistical Inference

Authors: George Casella, Roger L. Berger

2nd edition

0534243126, 978-0534243128

More Books

Students also viewed these Mathematics questions