I need help with a MATLAB code. I need to find two values of n, one that is positive and one that is negative, that will give all negative real roots. Can you help me find them?   function [r] = find_roots(n)     % Define constants    I = 400;    J = 150;    x = (J/I) - 1;    y = n - 1;    Q = y + x*(y-1);     % Define the coefficients of the quadratic equation    coefficients = [1, 0, (3*x+Q^2+1), 0, (3*x*Q+Q^2)];     % Find the roots    r = roots(coefficients);      end

Elements Of Electromagnetics
7th Edition
ISBN:9780190698614
Author:Sadiku, Matthew N. O.
Publisher:Sadiku, Matthew N. O.
ChapterMA: Math Assessment
Section: Chapter Questions
Problem 1.1MA
icon
Related questions
Question

I need help with a MATLAB code. I need to find two values of n, one that is positive and one that is negative, that will give all negative real roots. Can you help me find them?

 

function [r] = find_roots(n)

    % Define constants
    I = 400;
    J = 150;
    x = (J/I) - 1;
    y = n - 1;
    Q = y + x*(y-1);

    % Define the coefficients of the quadratic equation
    coefficients = [1, 0, (3*x+Q^2+1), 0, (3*x*Q+Q^2)];

    % Find the roots
    r = roots(coefficients);


    

end

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Elements Of Electromagnetics
Elements Of Electromagnetics
Mechanical Engineering
ISBN:
9780190698614
Author:
Sadiku, Matthew N. O.
Publisher:
Oxford University Press
Mechanics of Materials (10th Edition)
Mechanics of Materials (10th Edition)
Mechanical Engineering
ISBN:
9780134319650
Author:
Russell C. Hibbeler
Publisher:
PEARSON
Thermodynamics: An Engineering Approach
Thermodynamics: An Engineering Approach
Mechanical Engineering
ISBN:
9781259822674
Author:
Yunus A. Cengel Dr., Michael A. Boles
Publisher:
McGraw-Hill Education
Control Systems Engineering
Control Systems Engineering
Mechanical Engineering
ISBN:
9781118170519
Author:
Norman S. Nise
Publisher:
WILEY
Mechanics of Materials (MindTap Course List)
Mechanics of Materials (MindTap Course List)
Mechanical Engineering
ISBN:
9781337093347
Author:
Barry J. Goodno, James M. Gere
Publisher:
Cengage Learning
Engineering Mechanics: Statics
Engineering Mechanics: Statics
Mechanical Engineering
ISBN:
9781118807330
Author:
James L. Meriam, L. G. Kraige, J. N. Bolton
Publisher:
WILEY