Question: Using MATLAB Please do not use for and while loops Please copy and paste the code Type or paste question here x1 x3 x5 x?

Using MATLAB

Please do not use for and while loops

Please copy and paste the code

Using MATLAB Please do not use for and while loops Please copyType or paste question here

x1 x3 x5 x? 1+31 +51 + 1 + ... (inifinite terms) describes the hyperbolic sine or sinh function. Write a MATLAB script (M file) to compute an approximation to this function by truncating the sum after a finite number of terms, i.e. x1 x3 x5 x? sinh2(x,n) = utat att.. n terms). In order to do this, complete the following steps in an M file named hypersine.m (a) Read/Input n (the number of terms in the sum approximation) and x (the function argument) from the user. Make sure you let the user know clearly what to input and display the inputted values. (b) Create a vector On which contains the first n odd integers, i.e. 1,3,5 .. (n terms) (c) Using On, create a vector Xn which contains the terms x, x', X... (n such terms). (d) Using On, create a vector in which contains the factorials of first n odd integers. Thus the terms in the Fn vector should be 1!, 3!, 5! ... and so on up to n terms. (e) Using Fn and Xn, create vector Zn which contains n terms x/1!, x/3!, x/5! ..... (f) Sum the terms in Zn to compute the value of sinh2(x,n). (g) Compare the result to the actual value of sinh(x), which can be estimated using an in- built MATLAB function. Indicate the error as a fraction of the actual value. Once you've created the M file, open a new live script and write in the following commands before executing (run all) the live script and saving to PDF. During execution, enter n = 6 and x=4. Make sure all vectors On, Xn, Fn, Zn and values in (f) and (g) are displayed during execution. Upload PDF to WTClass Exam. %NAME, PROBLEM, DATE type hypersine.m hypersine

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!