Question

Use Matlab to graph the functions f(x) = 3xsin(3x) and g(x)= 12 - 2x² so that you can read off the point(s) of intersection (PLEASE USE MATLAB COMMANDS THANK YOU

0 0
Add a comment Improve this question Transcribed image text
Answer #1

MATLAB CODE

%defining the function f(x) and g(x)

%. dot command allows for element wise multiplication this is what allows us to use f1=f(x) and g1=g(x)
f=@(x) 3.*x.*sin(3.*x);
g=@(x) 12-2.*(x.^2);

%command to create x vector from -10 to 10 with 0.01 spacing
x=-10:0.01:10;

%producing the vector of f(x) and g(x) and storing in f1 and g1
f1=f(x);
g1=g(x);

%Plotting x Vs f(x) and xVs g(x)
plot(x,f1);
%hold on is used to plot 2 many plots in one figure
hold on
plot(x,g1);

xlabel("x")
ylabel("f(x),g(x)")
legend("f(x)","g(x)")


OUTPUT

The intersection points can be seen on the graph

x1,y1=(-2.21,2.23) x2,y2=(2.21,2.23)

X -2.21 Y 2.2318 X 2.21 Y 2.2318 (x)6*(x)} -150 -200 -10 -8 6 4 2 0 2 4 6 8 10

Add a comment
Know the answer?
Add Answer to:
PLEASE USE MATLAB COMMANDS THANK YOU Use Matlab to graph the functions f(x) = 3xsin(3x) and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT