How to graph multiple points onto one graph?

52 ビュー (過去 30 日間)
Brian Len
Brian Len 2020 年 5 月 19 日
コメント済み: Pranjal Johri 2023 年 7 月 26 日
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)

採用された回答

Robert U
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

その他の回答 (1 件)

KSSV
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') ;
  1 件のコメント
Pranjal Johri
Pranjal Johri 2023 年 7 月 26 日
doesnt work

サインインしてコメントする。

カテゴリ

Help Center および File Exchange2-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