%equation for y
yFunction = @(t) ((4.*t.^3)+(3.*t.^2)+(5.*t)+5);
%Plotting the function
fplot(yFunction,[-10,10]);
I am trying to find the minimum and maximum values of this function and I was wondering if there is a way to make an array of the outputs from the function. Then, with the array I can find the min and max values.
Cheers!

 채택된 답변

darova
darova 2020년 4월 29일

0 개 추천

Try this solution

댓글 수: 2

Carly Hudson
Carly Hudson 2020년 4월 29일
Thank you so much! I am new to MatLab and greatly appreciate the help!!!
darova
darova 2020년 4월 29일
You are welcome!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

David Hill
David Hill 2020년 4월 29일

0 개 추천

If your equations will always be polynomials, then
p=poly([4,3,5,5]);
d=polyder(p);
r=roots(d);
x=polyval(p,r);
relative_min=min(x);
relative_max=max(x);

카테고리

도움말 센터File Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

질문:

2020년 4월 29일

댓글:

2020년 4월 29일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by