My function is just y=2050 and I need to plot it w/o using "yline", because it's not a graph, actually. I just type this:
x=[0:0.1:110];
y=[0:10:2060];
g=2050;
plot(x,g)
And I don't get anything. Like, completely anything:
And also after that I need to mark a point (100,2050) and be able to make it bigger than my graph.
How do I solve these problems?

 채택된 답변

Mikhail Konovalov
Mikhail Konovalov 2020년 5월 13일
편집: Mikhail Konovalov 2020년 5월 13일

0 개 추천

Great thanks to drummer and darova! I finally have the graph I wanted. Final code:
x=[0:0.1:110];
y=[0:10:2060];
g=2050;
p1=plot(x,g+x*0,"g");
p1.LineWidth=2;
hold on
p2=plot(100,2050,"r*");
p2.LineWidth=15;
xlim([1 110])
Result:

추가 답변 (2개)

darova
darova 2020년 5월 12일

1 개 추천

Try this

댓글 수: 5

Mikhail Konovalov
Mikhail Konovalov 2020년 5월 13일
Can't see it clear enough. Could you write it with printed text, please?
plot(x,g+x*0)
Mikhail Konovalov
Mikhail Konovalov 2020년 5월 13일
Thank you, it looks very nice. How do I mark a point in this graph, though?
darova
darova 2020년 5월 13일
Can you make a simple sketch of the result you expect?
Mikhail Konovalov
Mikhail Konovalov 2020년 5월 13일
I've already got the result I wanted. Thank you!

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

drummer
drummer 2020년 5월 12일
편집: drummer 2020년 5월 12일

1 개 추천

y = 0:0.1:110;
x = 2050.* ones(length(y));
plot(y,x)
xlim([1 110])

댓글 수: 1

Mikhail Konovalov
Mikhail Konovalov 2020년 5월 13일
Looks nice! And how do I set a point at (100;2050)?

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

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2020a

태그

Community Treasure Hunt

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

Start Hunting!

Translated by