No data points appear on the graph when I hit run

10 次查看(过去 30 天)
figure (1) %selects plotting window #1
plot(0, 98, 'c--', .02, 245, 'c--', .04, 490, 'c--', .05, 735, 'c--', .06, 931, 'c--', .08, 931, 'c--', .10, 980, 'c--');
I tried adding brackets like this ( [x,y,s,] ) and the graph itself dissapered

回答(1 个)

DGM
DGM 2021-9-13
编辑:DGM 2021-9-13
When you plot points one at a time, they are rendered as single unconnected points. Since there is no specified marker type, they don't show up.
You could specify a marker type (i'm using blue so it shows up better against white on the web-view)
plot(0, 98, 'bx', .02, 245, 'bx', .04, 490, 'bx', .05, 735, 'bx', .06, 931, 'bx', .08, 931, 'bx', .10, 980, 'bx');
or you could plot the points as a series
clc
x = [0 0.02 0.04 0.05 0.06 0.08 0.10];
y = [98 245 490 735 931 931 980];
plot(x,y,'b--')

类别

Help CenterFile Exchange 中查找有关 Discrete Data Plots 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by