Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Basic MATLAB function using VECTORIZATION, and ERROR definitions You probably already know from calculus that you can write sin( Create a MATLAB function the sum

image text in transcribed
Basic MATLAB function using VECTORIZATION, and ERROR definitions You probably already know from calculus that you can write sin( Create a MATLAB function the sum of the terms up to the power xN. That is, evaluate to calculate (-1)' (k-11/2 x S(x.N)- k! -1,3.5, 23 25 2 2 2" For example, S(2,11)-2- 0.909296136 Your function must accept two inputs (x and N) and output one value representing S(x,N) What's the catch? NOWHERE in your function can you use FOR or WHILE loops, or IF commands!!! You must think how to do all calculations in a "vectorized" way, (Hint: maybe create a vector of just the odd values of k from 1 to N; then use MATLAB's element-by element math operators to create a vector in which the elements are (-1)-ila k! ; then use the sum function to add up the terms of the vector. Or, maybe you have another way of doing it. Just don't use for-while-if!!) (k-1)/2

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

More Books

Students also viewed these Databases questions

Question

Describe the factors influencing of performance appraisal.

Answered: 1 week ago