how to make graph for this function

2 vues (au cours des 30 derniers jours)
Eva
Eva le 15 Nov 2020
f:y=Ix4I+Ix25x+6I−Ix+4I+4.

Réponses (1)

Setsuna Yuuki.
Setsuna Yuuki. le 15 Nov 2020
Modifié(e) : Setsuna Yuuki. le 15 Nov 2020
You can use fplot()
for example:
syms x;
y = @(x) abs(x-4)+abs(x^2-5*x+6)-abs(x+4)+4;
fplot(y,'LineWidth',3);
xlim([-6 12])
more info: https://es.mathworks.com/help/matlab/ref/fplot.html
  2 commentaires
Eva
Eva le 15 Nov 2020
Thank you very much but it says this: "Warning: Function behaves unexpectedly on array inputs. To improve performance, properly vectorize your function to return an output with the same size and shape as the input
arguments.
> In matlab.graphics.function.FunctionLine>getFunction
In matlab.graphics.function/FunctionLine/updateFunction
In matlab.graphics.function.FunctionLine.set.Function_I
In matlab.graphics.internal.figfile.FigFile/read (line 31)
In matlab.graphics.internal.figfile.FigFile
In loadFigure (line 31)
In openfig>localOpenFigure (line 75)
In openfig (line 40)
In open (line 132)
In uiopen (line 159)" How to fix it, please?
I need to make graph+asymptotes
Setsuna Yuuki.
Setsuna Yuuki. le 15 Nov 2020
Modifié(e) : Setsuna Yuuki. le 15 Nov 2020
Another way:
x = linspace(-6,12,2000);
y = abs(x-4)+abs(x.^2-5*x+6)-abs(x+4)+4;
plot(x,y,'LineWidth',2)

Connectez-vous pour commenter.

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by