Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Code has already been provided to define a function named vectorFun that accepts a single input variable A that is a column vector of random

Code has already been provided to define a function named vectorFun that accepts a single input variable A that is a column vector of random numbers with values between and . Add commands to do the following operations and assign the results to the indicated output variable names:
Generate a second column vector B that consists of only the negative numbers in A in the same order in which they occur in A.
Generate a third column vector C that consists of only the positive numbers in A but this time sorted in order from smallest to largest.
Generate a fourth scalar output D that counts how many of the elements of A are between and .
Solve this problem using vectorized code. Your code should not include the following MATLAB functions or keywords: if, for, while. Note the variable A is defined as a function input. Do not overwrite the value in your code.

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_2

Step: 3

blur-text-image_3

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 Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions