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
What is Brainly?<br><br> A.Yes<br> B.No
mr Goodwill [35]

Answer: C: Yesn't

Explanation:

3 0
3 years ago
Read 2 more answers
a ____ consists of wires connecting the cpu and other parts of the computer. The _____ transfers data between CPU and memory uni
geniusboy [140]

Answer:

A power supply consists of wires connecting the cpu and other parts of the computer. The data bus transfers data between CPU and memory unit.

Explanation:

4 0
2 years ago
From the television industry's point of view, which of the following would be the most desirable viewer?
slava [35]
A 50-year-old African American man
4 0
3 years ago
All HTML5 webpages must begin with the HTML element _____.
Paul [167]

Answer:

yes, an HTML webpage must begin with an HTML element

Explanation:

<HTML> <!-- Website Content --> </HTML>

3 0
2 years ago
# 12/9/2020
EastWind [94]

where it says   " def main() " there needs to be something in the "()"

Hope this helps.   : )

3 0
3 years ago
Other questions:
  • You use_____ to view an XPS file
    10·1 answer
  • As part of his proofreading process, and to catch any spelling or grammar mistakes, John uses this feature in Word Online to hav
    7·1 answer
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    15·1 answer
  • You are given two int variables j and k, an int array zipcodeList that has been declared and initialized, an int variable nZips
    10·2 answers
  • What do character formats do for your document's message? A. Set how text aligns within a document B. Provide organization C. Pr
    6·2 answers
  • What method is used to manage contention-based access on a wireless network?
    7·1 answer
  • Angela recently purchased a new Android smartphone. While purchasing the phone, Angela was told that she would need to set up a
    14·1 answer
  • How is a microkernel architecture different from a monolithic architecture?
    5·1 answer
  • Security Definition updates for windows defender are performed through the ——— function in windows server 2016
    7·2 answers
  • The term ________ refers to the use of a single unifying device that handles media, Internet, entertainment, and phone needs. Gr
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!