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

h(x) = -4(x + 2)(x - 18)

In Matlab, at what input is the output 0 ?

I'm using Matlab R2021a.
MATLAB ProgrammingMath / Science

Last Comment
phoffric
d-glitch

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
naseeam

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

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.
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
``````
But fzero gives errors if there is no zero crossing.
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

TRUSTED BY