Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Homework # 1 Use a for loop to find the sum of all numbers divisible by 3 in the following array: x = [ 1

Homework #1
Use a for loop to find the sum of all numbers divisible by 3 in the following array:
x=[1,3,4,5,7,9,12,16,21,25]
Repeat Problem 1, this time using a while loop.
Develop a MATLAB function to compute the Maclaurin series expansion for the cosine function given
as:
cosx=n=0(-1)n(2n)!x2n=1-x22!+x44!-x66!+cdots
Test your program for: =3(60) and =73(420).
The first line of the function should be:
function [fx,ea,et,iter]= Lastname_Cos(x,es, maxit)
Note: Pattern your function according to the sample in Fig. 4.2. Be sure to calculate the et value also.
The velocity of a rocket might be described by:
v(t)={10t2-5t,0t8624-3t,8t1636t+12(t-16)2,16t262136e-0.1(t-26),t>260otherwise
First, develop a function file (using the if ... else structure) with the first line:
function v= Lastname_Vel (t) to compute velocity as a function of time for each interval.
Then, write a script named as Lastname_Call_Vel that uses the function to generate a plot of v
versus t for t=-5 to 50. Label your plot accordingly.
Hint: You will need a loop to create the corresponding values of t and v, where v is based on the
function you created.
Note: Do NOT use the built-in piecewise function for this problem.
Also, ensure that each MATLAB file is named appropriately, starting with your last name.
image text in transcribed

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

Oracle 10g SQL

Authors: Joan Casteel, Lannes Morris Murphy

1st Edition

141883629X, 9781418836290

More Books

Students also viewed these Databases questions

Question

What differentiates you from your competitors?

Answered: 1 week ago

Question

How do you monitor the effectiveness of the coaching?

Answered: 1 week ago