Avatar of naseeam
naseeamFlag for United States of America

asked on 

In Matlab, for a quadratic equation, how to find input at specific output?

Please consider following quadratic equation or parabola:
h(x) = -4(x + 2)(x - 18)

In Matlab, at what input is the output 0 ?

I'm using Matlab R2021a.
MATLAB ProgrammingMath / Science

Avatar of undefined
Last Comment
phoffric
Avatar of d-glitch
d-glitch
Flag of United States of America image

You have a quadratic function in factored form.
You don't need Matlab to solve it.
h(x) = 0 for x= -2 and x= 18
Avatar of naseeam
naseeam
Flag of United States of America image

ASKER

I know I don't need Matlab to solve just a simple equation but I want to know how to solve it in Matlab.
ASKER CERTIFIED SOLUTION
Avatar of phoffric
phoffric

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of phoffric
phoffric

Or, for general functions, you can find local zeros with good intial guesses
hf = @(x)  -4*(x + 2).*(x - 18);
rzeros(1) = fzero( hf, -20 );
rzeros(2) = fzero( hf, +20 );
rzeros

Open in new window

But fzero gives errors if there is no zero crossing.
Math / Science
Math / Science

The Math / Science topic primarily includes discussions of mathematics, physics, statistics and economic analysis, but also biology, chemistry and other sciences.

10K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo