Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1) Write a function in Matlab, which takes as input a vector of data values and returns two outputs, one output which is the number

image text in transcribed
1) Write a function in Matlab, which takes as input a vector of data values and returns two outputs, one output which is the number of values in the input vector which are greater than or equal to zero, the other output being the number of values in the input vector which are less than zero. Comment your function and provide a description near the top of the function, which explains, in very clear terms, how your algorithm accomplishes the task at hand Problem constraint: you must use a for loop, which searches through the components of the input vector, one at a time, to determine whether the individual components are greater than or equal to zero or less than zero, and you must increment counter variables within the for loop to produce the two output values Test your function on several data sets. You should choose data sets which fully test your algorithm for correctness, but you do not need to make your data sets very long. Summarize key numerical results, and make it easy to see that your algorithm works correctly over all tested data sets

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions