How to graph multiple points onto one graph?
258 次查看(过去 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') ;
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!