Could anybody help to solve the issue.

조회 수: 1 (최근 30일)
Prabha Kumaresan
Prabha Kumaresan 2018년 3월 27일
댓글: Prabha Kumaresan 2018년 3월 27일
I want to plot the graph for the command line
plot(rng,final1,'-rs');
when i run the code the values of rng and final1 displayed in the command window as :
rng = 1
final1 =1.8635e+10
rng = 2
final1 =2.0387e+10
rng = 23
final1 =2.1245e+10
But i am getting the graph as attached.In the graph the final1 values remain fixed with respect to different values of rng. could anyone help me to plot the graph for corresponding values of rng and final1.

채택된 답변

Birdman
Birdman 2018년 3월 27일
Why don't you try this?
rng=[1 2 23]
final=[1.8635e+10 2.0387e+10 2.1245e+10]
plot(rng,final,'-rs');grid on
  댓글 수: 10
Birdman
Birdman 2018년 3월 27일

This will give you one graph:

rng = 1; 
final1 =1.8635e+10;
plot(rng,final1,'o');hold on;
rng = 2; 
final1 =2.0387e+10;
plot(rng,final1,'o');
rng = 23;
final1 =2.1245e+10;
plot(rng,final1,'o');

or my initial answer:

 rng=[1 2 23]
 final=[1.8635e+10 2.0387e+10 2.1245e+10]
 plot(rng,final,'o');grid on
Prabha Kumaresan
Prabha Kumaresan 2018년 3월 27일
ok.thanks

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by