How to graph multiple points onto one graph?
조회 수: 90 (최근 30일)
이전 댓글 표시
I am trying to make these multiple points onto one graph, but when I try, it does not show it. Here are the points. any help?
(0,3.8*10^8)
(1,4.2*10^7)
(2,1.5*10^7)
(3,7.8*10^7)
(4,4.7*10^6)
(5,3.16*10^6)
(6,2.3*10^6)
(7,1.7*10^6)
(8,1.3*10^6)
(9,1.05*10^6)
(10,8.66*10^5)
댓글 수: 0
채택된 답변
Robert U
2020년 5월 19일
편집: Robert U
2020년 5월 19일
Hi Brian Len,
you might have some troubles with syntax. Have a look at the very good documentation: https://de.mathworks.com/help/matlab/language-fundamentals.html
dInput = [0,3.8e8;
1,4.2e7;
2,1.5e7;
3,7.8e7;
4,4.7e6;
5,3.16e6;
6,2.3e6;
7,1.7e6;
8,1.3e6;
9,1.05e6;
10,8.66e5];
fh = figure;
ah = axes(fh);
hold(ah,'on');
plot(ah,dInput(:,1),dInput(:,2),'.')
Kind regards,
Robert
댓글 수: 0
추가 답변 (1개)
KSSV
2020년 5월 19일
data = [0,3.8*10^8
1,4.2*10^7
2,1.5*10^7
3,7.8*10^7
4,4.7*10^6
5,3.16*10^6
6,2.3*10^6
7,1.7*10^6
8,1.3*10^6
9,1.05*10^6
10,8.66*10^5] ;
x = data(:,1) ;
y = data(:,2) ;
figure
hold on
plot(x,y,'*r')
plot(x,y,'b')
legend('Markers plot','lineplot') ;
참고 항목
카테고리
Help Center 및 File Exchange에서 Directed Graphs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!