Question: Write a script without using loops that for a given vector will count how many of its elements are positive ( nP ) , how
Write a script without using loops that for a given vector will count how many of its elements are positive nP how many are negative nN and how many are equal to zero nZ Use logical indexing.
For instance,
if the vector is the answer would be nP nN and nZ
if the vector is the answer would be nP nN and nZ
Test your code for vector
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
