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]
4 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]4 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
1. (15%) Consider a computer system with three users: Alice, Bob, and Cyndy. Alice owns the file a, and Bob and Cyndy can read i
Fantom [35]

Answer:

answered in Image and explanation is given below.

Explanation:

CL is euqal to user permission on every file

ACL is equal to how permissions are defined for one life for example File a, read, write, execute.

4 0
3 years ago
When designing a laptop, which three things should designers think about?
FromTheMoon [43]

Answer:B,C,D

Explanation:

7 0
3 years ago
The factorial of an integer N is the product of the integers between 1 and N, inclusive. Write a while loop that computes the fa
alexdok [17]

the function and loop will be

def factorial(x):

   total = 1

   if x != 1 and x != 0:

       for i in range(x,1,-1):

           total *= i

   return total

3 0
4 years ago
Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since th
vovangra [49]

Complete Question:

Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode.

Group of answer choices;

A. Reboot into Safe Mode

B. Run compatibility mode for 640 x 480 resolution.

C. Reduce her screen resolution to 640 x480

D. Reboot into Low Resolution Mode

Answer:

B. Run compatibility mode for 640 x 480 resolution.

Explanation:

In this scenario, Missy loves her old Windows games. When she upgrades her Windows system, the games run fine, but the output looks fuzzy since the programs are designed only to run in VGA mode. In order to make the games work properly in Windows, Missy should run compatibility mode for 640 x 480 resolution.

The video graphics array (VGA) is the standard graphics or display interface used for computer monitors. It was developed in 1987 by IBM and it had a standard display resolution of 640 x 480 pixels.

<em>Hence, if the output of a software program (games) looks fuzzy or is not being displayed properly, you should run compatibility mode for 640 x 480 resolution. This is to enable low resolution video mode on the computer. </em>

The VGA mode is very basic because only minimal video drivers are being loaded on the windows.

4 0
3 years ago
True or False: Cracking a Vigenère cipher with brute force takes longer than a Caesar cipher, but it is still a reliable method
iragen [17]

Answer:

False

Explanation:

The Vigenere cipher is an encryption method that uses a series of interwoven Ceaser ciphers and a keyword to encrypt text. The difference between this cipher and the Ceaser cipher is the tabular interwoven Ceaser cipher and the keyword.

Multiple keywords can be used in the Vigenere cipher. The use of this keyword makes the brute-force decipher algorithm unreliable for decoding text encrypted with it.

7 0
3 years ago
Other questions:
  • Create a class in JobApplicant.java that holds data about a job applicant. Include a name, a phone number, and four Boolean fiel
    13·1 answer
  • A key or combination of keys that complete an action more efficiently than using the mouse is called a(n) keyboard shortcut.
    8·1 answer
  • An EEG measures the electrical output of the brain by using sensors that are attached to someone's hands and feet. Please select
    15·2 answers
  • A short circuit locator should be periodically run along the cords used in a shop to check for shorts and open circuits. A.)True
    12·2 answers
  • Co to jest podprogram (procedura lub funkcja)? Zaznacz poprawną odpowiedź. a) Wielokrotne powtarzanie tych samych poleceń. b) Wy
    8·1 answer
  • You have a notebook computer and wish to connect to an IEEE 802.11n wireless network. The computer does not have a built-in wire
    11·1 answer
  • Why did Herman Hollerith invent the Tabulating Machine?
    10·1 answer
  • A filter is a camera accessory that is mounted on the optical path of the lens.<br> true or false
    6·2 answers
  • Modify your previous exercise to determine if the user can ride a rollercoaster. To ride the rollercoaster, you must be at least
    12·1 answer
  • Why is my Brainly scanner not work​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!