Answered step by step
Verified Expert Solution
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
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started