1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ss7ja [257]
3 years ago
11

Write a MATLAB program using afor loopto determine the number of values thatarepositive, the number of values that are negative,

and the number of values that equal zero ina vector containing N elements. Prompt the user to enter N and the vector of values and thendisplay the number of positive, negative, and zero values.
Computers and Technology
1 answer:
murzikaleks [220]3 years ago
7 0

Answer:

see description

Explanation:

clicking in new script, we type the following:

%inputs and variables

N = input('Enter N : ');

values = input('Enter values : ');

positive=0;

negatives=0;

zero=0;

%for loop

for c = 1:N

   if values(c) > 0

       positive = positive + 1;

   elseif values(c) < 0

       negatives = negatives + 1;

   else

       zero = zero + 1;

   end

end

positive

negatives

zero

so we basically loop the array and add one to counters each time we read an element from the input, for example if we enter:

Example input

Enter N : 5

Enter values : [1,-1,0,2,352]

positive = 3

negatives = 1

zero = 1

You might be interested in
I damaged a k12 laptop. do I have to pay for the damage? and if so how much?
Gnesinka [82]

You explain your situation, they send you a new computer, then mail to them the broken computer and later pay a $200-350 dollar fee. I think it depends on how much damage you made to it.

5 0
3 years ago
Identify any eight new programming languages and classify them based on their functionality.
shepuryov [24]

Answer:

Some of the new programming languages are R, Python, Haskell, Swift, C++, Java, Javascript and PHP.

However, you should know that in general sense there are three types of programming languages.

R is a pure object-oriented programming language being used for scientific purposes, and now it is being used extensively for machine learning as well.

Python is also a pure object-oriented programming language, and it is being used for mainly machine learning. However, you need to keep in mind that it supports the functional programming paradigm as well.

Haskell is a functional programming language and is the best in the functional paradigm as well. You can compare it with LISP, FORTRAN and PASCAL or COBOL, and you will find that Haskell is the best.

Swift is a pure object-oriented programming language, And by pure it means it never cheats anybody like if it says a variable is an int, it will be an int and not like C# here a string data type can be an integer data type. And this is not the correct thing. However, if you study in deep, you will find it is a necessary evil.

C++ and Java are imperative programming languages.

The Javascript and PHP are the scripting languages that support the object-oriented programming concepts but not fully, and they too fall under the imperative programming language list.

Explanation:

The answer is self explanatory.

4 0
3 years ago
Read 2 more answers
You would like to help guide your company in choosing between valuing privacy and increasing the company's bottom line. What is
Ainat [17]

In the above case, the option that will help to guide your company in choosing between valuing privacy is a set of internal principles.

<h3>What are internal control principles?</h3>

The principles of internal control are known to be  needed in the management to set methods in place to make sure that company assets are kept.

Therefore, In the above case, the option that will help to guide your company in choosing between valuing privacy is a set of internal principles.

Learn more about internal principles from

brainly.com/question/27015769

#SPJ1

6 0
2 years ago
Este tipo de software sirve para controlar e interactuar con el sistema operativo, proporcionando control sobre el hardware y da
attashe74 [19]

Answer: c

Explanation:

4 0
3 years ago
Monica is writing a paper, and it needs to contain a certain amount of words. What Word Online feature can she use?IndentingProo
Greeley [361]

Answer:

Its word count so she knows how much words she is writing

Explanation:

7 0
2 years ago
Other questions:
  • In a social networking site your personal information is listed under your inbox. home. status. profile.
    11·1 answer
  • What is basic function of an operating system?
    10·2 answers
  • 11. You should type _
    6·2 answers
  • Which of the following is a social news-sharing service?
    10·2 answers
  • Which of the following information should be included in audit documentation? a. Procedures performed. b. Audit evidence examine
    13·1 answer
  • You want to make the background of a Web page blue, click _____.
    13·2 answers
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • What is the result of executing the following code? You can assume the code compiles and runs. #include using namespace std; voi
    6·1 answer
  • Can someone send me reference on communication, importance , communication cycle , pros and cos​
    15·1 answer
  • Susan wants to play the games that come with Windows on her computer, but they are not on the Start menu. What should she do in
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!