Problems by calculating zero points of a cubic function
Hey there,
I have the following problem: let´s say I want to calculate the zero points of the cubic function:
f(x) = -2 x^3 + x^2 + 0.5 x – 8
I already know the respective solution:
p = roots([-2 1 0.5 -8])
The answer p is a vector with all three possible solutions.
Now my problem:
I would like to vary the third coefficient – that is 0.5 – by several values 0.1, 0.2, … , 0.5
That would be like
x=0.1:0.1:0.5;
p = roots([-2 1 x -8])
The problem is that the respective solutions are wrong.
What is my mistake?
How should I do it instead?
Thx a lot in advance!
Best regards,
TimHey there,
I have the following problem: let´s say I want to calculate the zero points of the cubic function:
f(x) = -2 x^3 + x^2 + 0.5 x – 8
I already know the respective solution:
p = roots([-2 1 0.5 -8])
The answer p is a vector with all three possible solutions.
Now my problem:
I would like to vary the third coefficient – that is 0.5 – by several values 0.1, 0.2, … , 0.5
That would be like
x=0.1:0.1:0.5;
p = roots([-2 1 x -8])
The problem is that the respective solutions are wrong.
What is my mistake?
How should I do it instead?
Thx a lot in advance!
Best regards,
Tim Hey there,
I have the following problem: let´s say I want to calculate the zero points of the cubic function:
f(x) = -2 x^3 + x^2 + 0.5 x – 8
I already know the respective solution:
p = roots([-2 1 0.5 -8])
The answer p is a vector with all three possible solutions.
Now my problem:
I would like to vary the third coefficient – that is 0.5 – by several values 0.1, 0.2, … , 0.5
That would be like
x=0.1:0.1:0.5;
p = roots([-2 1 x -8])
The problem is that the respective solutions are wrong.
What is my mistake?
How should I do it instead?
Thx a lot in advance!
Best regards,
Tim roots polynom or cubic funtion MATLAB Answers — New Questions