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
Veronika [31]
3 years ago
15

Write a MATLAB program to solve for the roots of a quadratic equations, regardless of type. Use complex variables so that no bra

nches will be required based on the value of the discriminant. g
Computers and Technology
1 answer:
slavikrds [6]3 years ago
5 0

Explanation:

PROGRAM  QuadraticEquation

  IMPLICIT  NONE

  REAL  :: a, b, c

  REAL  :: d

  REAL  :: root1, root2

   

!  read in the coefficients a, b and c

  READ(*,*)  a, b, c

  WRITE(*,*) 'a = ', a

  WRITE(*,*) 'b = ', b

  WRITE(*,*) 'c = ', c

  WRITE(*,*)

!  compute the square root of discriminant d

  d = b*b - 4.0*a*c

  IF (d >= 0.0) THEN            

     d     = SQRT(d)

     root1 = (-b + d)/(2.0*a)  

     root2 = (-b - d)/(2.0*a)

     WRITE(*,*)  'Roots are ', root1, ' and ', root2

  ELSE                          

     WRITE(*,*)  'no real roots exist!'

     WRITE(*,*)  'Discriminant = ', d

  END IF

END PROGRAM  QuadraticEquation

You might be interested in
Which of the following is not one of the Fatal Four events that cause three out of five construction worker deaths? A. Caught in
k0ka [10]

The answer is D: Struck down.

Options A, B, and C are the most common types of fatal construction accidents in the United States. Falls, electrocutions, being struck by an object, and workers caught in or between things are responsible for over 64% of construction workers death. Among these four events, falls kill most construction workers followed by electrocutions, falling objects, and workers caught in or between things.


5 0
3 years ago
Read 2 more answers
Match the data type to the given data.
guapka [62]
Float: 26.2
Array: c, o, m, p, u, t, er
Boolean: false
Character: c
7 0
3 years ago
After establishing a long-term goal and understanding what it entails the best next step is to A plan numerous immediate short-t
qaws [65]

Answer:

A

Explanation:

After you make a big goal you must make many small goals to reach it

8 0
4 years ago
Read 2 more answers
Why is hydrgoen in any group on the periodic table
Radda [10]

Answer:

Hydrogen is placed above group in the periodic table because it has ns1 electron configuration like the alkali metals. However, it varies greatly from the alkali metals as it forms cations (H+) more reluctantly than the other alkali metals. ... Hydrogen has a much smaller electron affinity than the halogens.

8 0
3 years ago
Read 2 more answers
Order the steps to autofilter data
Lena [83]

Answer:

Select the data you want to filter.

Click Data > Filter.

Click the arrow. ...

Choose specific values: Uncheck (Select All) to clear all of the check boxes, and then check the boxes for the specific value(s) you want to see.

Explanation:

1. Select the data you want to filter.

2. Click Data > Filter.

3. Click the arrow. ...

4. Choose specific values: Uncheck (Select All) to clear all of the check boxes, and then check the boxes for the specific value(s) you want to see.

3 0
3 years ago
Other questions:
  • Which type of cause and effect organizer would be best for alisha to understand how crude oil becomes gasoline?
    6·2 answers
  • As a safe driver, you cannot, __________
    13·1 answer
  • In this lab, 172.30.0.0 represents the __________ network and 10.20.1.0 represents the _________ network.
    11·1 answer
  • (3 points) Write a program to process two large chunks of data (e.g., a large 3D array and an array of self-defined structures w
    11·2 answers
  • What are minimum computer requirements for a software program?
    5·1 answer
  • Which of the following Python methods in scipy.stats submodule returns the P-value for performing a hypothesis test for the sign
    11·1 answer
  • Give a recursive algorithm that takes as input a string s, removes the blank characters and reverses the string. For example, on
    7·1 answer
  • Can someone tell me how to fix the keyboard on ipad?- its in the middle of my screen andd i dont know how to do it
    13·1 answer
  • 25 Points Asap <br> Write a Java program named Light.java that displays a light bulb shown below:
    14·1 answer
  • a. Describe how the student can use the jar of rice to model particle motion of a substance in each state of matter: solid, liqu
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!