How to graph multiple points onto one graph?
289 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Brian Len
am 19 Mai 2020
Kommentiert: Pranjal Johri
am 26 Jul. 2023
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 Kommentare
Akzeptierte Antwort
Robert U
am 19 Mai 2020
Bearbeitet: Robert U
am 19 Mai 2020
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 Kommentare
Weitere Antworten (1)
KSSV
am 19 Mai 2020
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') ;
Siehe auch
Kategorien
Mehr zu Directed Graphs finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!