Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Look up linspace. In your m-file, use linspace to define a row vector named xxthat has 400 equally spaced points that vary in value from

Look up linspace. In your m-file, use linspace to define a row vector named xxthat has 400 equally spaced points that vary in value from -5 to 5. Now calculate a function fx1. fx1=sin(3*pi*xx).*exp(-xx.^2);

This defines fx1 in terms of xx., using array multiplication. Now define another function, fx2, thats the same as fx1 except that the magnitude of fx2 cannot exceed 0.5.

fx2=zeros(size(xx));

for ii=1:length(xx)

if abs(fx1(ii))<0.5

fx2(ii)=fx1(ii);

elseif fx1(ii)>0.5

fx2(ii)=0.5;

elseif fx1(ii)<0.5

fx2(ii)=-0.5;

end

end

Look up the command while, and use a while loop to find the first value of xx where fx1 is greater than fx2. Include this in your m-file and put the answer in your write-up.

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

Database Design Query Formulation And Administration Using Oracle And PostgreSQL

Authors: Michael Mannino

8th Edition

1948426951, 978-1948426954

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago