Solve system of equations graphically

2 views (last 30 days)
Gintaras
Gintaras on 1 Nov 2022
Answered: Sam Chak on 2 Nov 2022
Hello, I am a total beginer with matlab and need to solve a system of equations graphically
Here is the system of equations:
Thanks in advance!
  3 Comments
Gintaras
Gintaras on 2 Nov 2022
Edited: Gintaras on 2 Nov 2022
x=-5:5
x = 1×11
-5 -4 -3 -2 -1 0 1 2 3 4 5
y=x.^3
y = 1×11
-125 -64 -27 -8 -1 0 1 8 27 64 125
z=6./x
z = 1×11
-1.2000 -1.5000 -2.0000 -3.0000 -6.0000 Inf 6.0000 3.0000 2.0000 1.5000 1.2000
plot(x,y,x,z)
am I doing this correctly?
Sam Chak
Sam Chak on 2 Nov 2022
I tested your code:
x = -5:0.05:5;
y1 = x.^3;
y2 = 6./x;
plot(x, y1, x, y2)
xticks([-5:5])

Sign in to comment.

Answers (1)

Sam Chak
Sam Chak on 2 Nov 2022
Alternatively, you can also do like this:
Solve or plot this polynomial:
x = -2:0.01:2;
y = x.^4 - 6;
plot(x, y), grid on
yline(0, '--')

Categories

Find more on Graphics in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!