![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/288643/image.png)
How to make an array of function outputs?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carly Hudson
am 29 Apr. 2020
Kommentiert: darova
am 29 Apr. 2020
%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!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
David Hill
am 29 Apr. 2020
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);
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!