I want my graph to show only red line. I'm not sure why it's showing orange line as well

조회 수: 1(최근 30일)
Ahmed
Ahmed 2020년 11월 14일
답변: VBBV 2021년 10월 23일
stem(x,y)
hold on
plot(x, 2.0477*exp(.4927*x))
x_dense= 0: .1: 5;
plot(x_dense, 2.0477 *...
exp(.4927*x_dense), 'r-')

답변(2개)

Ameer Hamza
Ameer Hamza 2020년 11월 14일
You have two plot() statements. Delete the first one if you just want red line
stem(x,y)
hold on
x_dense= 0: .1: 5;
plot(x_dense, 2.0477*exp(.4927*x_dense), 'r-')

VBBV
VBBV 2021년 10월 23일
y = [2 3 6 8 24];
x = linspace(0,5,length(y));
stem(x,y)
hold on
plot(x, 2.0477*exp(.4927*x))
x_dense= 0: .1: 5;
hold off
plot(x_dense, 2.0477 *...
exp(.4927*x_dense), 'r-');
Use a hold off between the two plot functions

태그

Community Treasure Hunt

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

Start Hunting!

Translated by