Answered step by step
Verified Expert Solution
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
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