Hi guys,
I am trying to plane something on the same figure. I have 3 plane (plot function). How can I evaluate on the same figure in the chosen interval like 3 equation (-10,10),
x = linspace(-5,5,100);
HomoDom=(a/(sqrt(6.28)))*(exp(-(x.^2))/2);
v=plot(x,HomoDom);
x = linspace(-5,5,100);
Hetero=(b/(sqrt(6.28)))*(exp(-(x.^2))/2);
b=plot(x,Hetero);
x = linspace(-5,5,100);
HomoRes=(a/(sqrt(6.28)))*(exp(-(x.^2))/2);
n=plot(x,HomoRes);

 채택된 답변

Adam Danz
Adam Danz 2020년 3월 18일

0 개 추천

See hold on.

댓글 수: 4

hold on
x = linspace(-5,5,100);
HomoDom=(a/(sqrt(6.28)))*(exp(-(x.^2))/2);
v=plot(x,HomoDom);
hold on
x = linspace(-5,5,100);
Hetero=(b/(sqrt(6.28)))*(exp(-(x.^2))/2);
b=plot(x,Hetero);
hold on
x = linspace(-5,5,100);
HomoRes=(a/(sqrt(6.28)))*(exp(-(x.^2))/2);
n=plot(x,HomoRes);
Ugur Sahin
Ugur Sahin 2020년 3월 18일
편집: Ugur Sahin 2020년 3월 18일
thanks but ı couldn't add third plot
Adam Danz
Adam Danz 2020년 3월 18일
You only need to run hold on once. It set's the axes' properties so that new objects won't replace old ones.
Why can't you add the 3rd plot? Is there an error? Is it not appearing? What's problem are you seeing?
My guess is that the 3rd plot is added without any problem but it's exactly the same as the first one since you're using the same input values.
Ugur Sahin
Ugur Sahin 2020년 3월 18일
Thanks you are right bro :D

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

질문:

2020년 3월 18일

댓글:

2020년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by