how to make graph for this function

2 Ansichten (letzte 30 Tage)
Eva
Eva am 15 Nov. 2020
Bearbeitet: Setsuna Yuuki. am 15 Nov. 2020
f:y=Ix4I+Ix25x+6I−Ix+4I+4.

Antworten (1)

Setsuna Yuuki.
Setsuna Yuuki. am 15 Nov. 2020
Bearbeitet: Setsuna Yuuki. am 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 Kommentare
Eva
Eva am 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. am 15 Nov. 2020
Bearbeitet: Setsuna Yuuki. am 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)

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by